2021-12-10 pythonを使ったテキストファイル読み込みコード python f = open('Sample.txt', 'r') data = f.read() print(data) f.close() ファイル上のテキストデータが表示される。