Skip to content

Instantly share code, notes, and snippets.

@showyou
Created May 16, 2020 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save showyou/5c586a99648393d6cbd6e78620b9c86a to your computer and use it in GitHub Desktop.
Save showyou/5c586a99648393d6cbd6e78620b9c86a to your computer and use it in GitHub Desktop.
ファイル読み込み
# sys.argvのlenに関しては(本当は良くないけど)今回は割愛
import sys
filename = sys.argv[1]
with open(filename) as f:
lines = f.readlines()
cnt = 0
for l in lines:
print(cnt, l.rstrip("\n"))
cnt += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment