open an html string in a browser?
Dennis Reinhardt
DennisR at dair.com
Sat Jan 18 16:47:04 EST 2003
> The reason is that zipfile.read('myfile.html') returns a string,
containing
> the contents of the file. However, Webbrowser requires a URL (in this case
> the name of an html file).
You *could* implement a very simple http server. the server returns the
string when requested by browser. The following command (among others)
launches browser:
os.startfile("http://localhost")
You would need port 80 open locally or attach to some other port and
identify same in URL..
--
Dennis Reinhardt
http://www.dair.com
More information about the Python-list
mailing list