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.
Expand|Select|Wrap|Line Numbers
- 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()
Thanks.