Skip to content

Instantly share code, notes, and snippets.

@kozo496
Created June 3, 2022 23:20
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 kozo496/7ef084653dd2c02cb5a053eada167e4a to your computer and use it in GitHub Desktop.
Save kozo496/7ef084653dd2c02cb5a053eada167e4a to your computer and use it in GitHub Desktop.
textファイルを読み込んで、行ごとのリストにする。
# `test.txt`ファイルから一行ずつ読み込む
with open('test.txt', 'r) as f:
lines = [line.rstrip() for line in f]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment