Pythonでテキストファイルを1行ずつ読み込む[Python]

7月 27, 2020

with
open("text.txt") as f:
for line in f:
print(line)

withを使いたくなければ,

f = open("text.txt")
for line in f:
print(line)
f.close()

Python

Posted by vastee