Python: storing print output from different module's function
<p>I'm trying to store the print output from a function of another module imported,
as a string and write it into a file. However, that function does not return a string, it only prints the output.
so I need something like:</p>

<pre><code>import someModule
......
f.open('test.v','w')
out = storetheprintoutputasstring(someModule.main())
f.write(out)
f.close
</code></pre>

<p>How do I do this?
Please help me out and thank you in advance</p>
