processing stdout in python
<p>I have a script that keeps on dumping some values to the screen. Lets call this script 1</p>

<p>I need the values that gets dumped to the screen to be processed by another python script.Lets call this script2. I Script1 cant be stopped</p>

<p>I currently use <strong>python 2.2</strong> so it would be great if someone could provide an example without using subprocess </p>

<p>script 1 looks something like this</p>

<pre><code>import sys
import os
i = 0
while 1:
    print i
    sys.stdout.write(str(i)+"\n")
        i = i + 1
</code></pre>

<p>I need to write script2 such that every output generated by script1 is processed by script2</p>

<p><strong>-- edit --</strong></p>

<p>I need it to run on a legacy implementation ie no power shell just the command prompt available in Windows XP</p>
