Pythonシェルに出力された情報をtxtファイルに保存することはできますか?
Python バージョン 2.7.2 を実行しています
これは、シェルに表示されるものです。
Enter numbers 1... 22,34,35,40,55
Enter numbers 2... 12,14,34,47,49
Enter numbers 3... 1,4,10,19,30
Section 1
The number seqeuce is # 0 0 1 2 1 1 # <--
Section 2
The number seqeuce is # 0 2 0 1 2 0 # <-- This is what I would like to save to txt.
Section 3
The number seqeuce is # 2 2 0 1 0 0 # <--
ファイルの読み取り、書き込み、追加の方法を調べて理解しましたが、シェルから直接ではありません。
この問題を解決するための提案をいただければ幸いです。