テキストファイル
foo
bar
baz
qux
quux
コード
# path_text: text の path
with open(path_text) as f:
lines = f.read().splitlines()
結果
print(lines)
['foo', 'bar', 'baz', ...]
もっと良い書き方ありましたら教えてください。
Go to list of users who liked
Share on X(Twitter)
Share on Facebook
More than 5 years have passed since last update.
テキストファイル
foo
bar
baz
qux
quux
コード
# path_text: text の path
with open(path_text) as f:
lines = f.read().splitlines()
結果
print(lines)
['foo', 'bar', 'baz', ...]
もっと良い書き方ありましたら教えてください。
Register as a new user and use Qiita more conveniently
Go to list of users who liked