Hi,

how can I combine some dynamically generated html code (using python) with the 
output of a urllib.openurl() call?

I have tried to use the StringIO() class with .write functions, but it did not 
work. Below is the code that does not work.

[CODE]
f=StringIO.StringIO()
f.write('<html><head><title>data analysis</title></head><body>')
f.write(urllib.urlopen("http://localhost/path2Libs/myLibs.py";, 
urllib.urlencode(TheData)))
f.write("</body></html>")

print "Content-type: text/html\n"
print f.read()
f.close()
[/CODE]

What is wrong with this approach/code? Is there an easier way of doing it?

Thanks.



--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to