I have two python modules: buildContent.py
which contains code that results in output i want. buildRun.py
which i run in order to redirect the output to a file.
I'm trying to save the output from buildContent.py
to a file and I did something like this in the buildRun.py
:
import buildContent
import sys
with open('out.xhtml', 'w') as f:
sys.stdout = f
print buildContent
I can see my output in the console but the file result is:
<module 'buildContent' from 'here's my path to the file'>
what to do?