with open("greeting.txt", encoding="utf-8") as file_obj: s = file_obj.read() print(repr(s)) # プログラム12-10(readで一気に読む)