Skip to content

Instantly share code, notes, and snippets.

@blacknon
Last active February 11, 2023 22:30
Show Gist options
  • Save blacknon/f251e638126dcd63398383de30cda6e1 to your computer and use it in GitHub Desktop.
Save blacknon/f251e638126dcd63398383de30cda6e1 to your computer and use it in GitHub Desktop.
fileを読んで処理する系の処理の動作検証コード(python)
fname = "./test.list"
with open(fname) as f:
content = f.readlines()
# you may also want to remove whitespace characters like `\n` at the end of each line
content = [x.strip() for x in content]
print(content)
if 'a' in content:
print("aaa ok")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment