Last active
February 11, 2023 22:30
-
-
Save blacknon/f251e638126dcd63398383de30cda6e1 to your computer and use it in GitHub Desktop.
fileを読んで処理する系の処理の動作検証コード(python)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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