Is it possible to save the information that is output to python shell into a txt file.
I’m running Python version 2.7.2
This is what’s displayed in the shell.
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 # <--
I’ve looked around and understand how to read, write and append files but not
directly from the shell.
I would greatly appreciate any suggestions to solve this problem.
its exactly the same in the shell, but you will basically be running the code one line at a time, instead of just running a file with it all together. Otherwise, you could just copy/paste the results…
Not quite sure if that’s what you were looking for, please let me know if it’s not.