Save specific info to txt from python shell
<p>Is it possible to save the information that is output to python shell into a txt file.</p>

<p>I'm running Python version 2.7.2</p>

<p>This is what's displayed in the shell. </p>

<pre><code>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 # &lt;-- 
Section 2                         
The number seqeuce is # 0 2 0 1 2 0 # &lt;-- This is what I would like to save to txt.
Section 3                         
The number seqeuce is # 2 2 0 1 0 0 # &lt;-- 
</code></pre>

<p>I've looked around and understand how to read, write and append files but not 
directly from the shell.</p>

<p>I would greatly appreciate any suggestions to solve this problem.</p>
