with open("greeting.txt", "r", encoding="utf-8") as file_obj: for _ in range(6): print(f"「{file_obj.read(8)}」") # プログラム12-7(ファイルからの入力)