writing a check program in python for other python files
<p>I am writing a check.py file which reads a file that maps a python file to an output. That file looks something like this</p>

<pre><code>001.py 233168
002.py 4613732
</code></pre>

<p>This means 001.py when ran should print out 233168. What is the best way to capture stdout from 00*.py? Overriding stdout and using execfile? or using a subprocess?</p>

<p>I have never done anything like this before, but it seems like </p>

<pre><code>  subprocess.check_output
</code></pre>

<p>does exactly what I want, is there a more appropriate way of doing this?</p>
