2022年8月9日火曜日

Python: print関数の結果をファイルに出力する

 print関数の結果をファイルに出力する

with open('file.txt', 'w') as f:
    print('abc', file=f)


0 件のコメント:

コメントを投稿