problem opening html file with webbrowser.open

Stefan Behnel stefan.behnel-n05pAM at web.de
Mon Oct 29 08:16:26 EDT 2007


krishnakant Mane wrote:
> as I posted in my previous thread, I am generating html reports for my
> client software.
> I am yet to find a satisfactory module which can help me actually
> create headings, bold and italics etc without merging html with data
> variables.

Maybe this is something for you:

http://codespeak.net/lxml/dev/lxmlhtml.html#creating-html-with-the-e-factory


> but my main issue is that when I use the
> webbrowser.open("file:///home/myname/report.html"), webbroser opens
> but the page does not come up.

Maybe your browser is not in the executable path? Try passing the PATH
environment variable to the Python interpreter and make sure it contains the
directory where your browser is installed.

Also, try requesting a specific browser type instead of the default one, and
use its controller object. Read the docs of the webbrowser module for that:

http://docs.python.org/lib/module-webbrowser.html

Stefan



More information about the Python-list mailing list