This is the python code from a file '
legend.py' that prints the contents of variable '
doc' to console:
Code:
print '\n'.join (doc)
Now through the above code, whatever is inside
doc gets written to the console, if I run
python legend.py description.xml
Code:
for z in {0..1}; do python legend.py -z $z description.xml > $z.html; done
The above script takes as an input the above mentioned python file '
legend.py' and '
description.xml' as an input of '
legend.py'
and
Then it generates
0.html and
1.html files containing the contents of variable '
doc'
Problem statement:
I want to write a python code, which writes the contents of
doc to an
html file,
inside 'legend.py'
rather than through the command prompt !!
I tried searching Google but couldn't get much help,
Please guide if you can !!