with open("greeting.txt", encoding="utf-8") as file_obj: lines = file_obj.readlines() print(repr(lines)) # プログラム12-12(readlinesで行のリストを得る)