problem opening html file with webbrowser.open

Jake McKnight jake.mcknight at gmail.com
Mon Oct 29 07:47:45 EDT 2007


> 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.

Clearly the browser is in the path, because it opens.  It just fails to open
the file supplied by the script.

> 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.

I just tested this in both Windows (Vista) and Linux (Kubuntu 7.10 and
Slackware 12) without any problems.  Try it from the interpreter; if it's
actually executing successfully, you should see something that looks like
this:

>>> import webbrowser
>>> webbrowser.open("file:///home/user/path/to/file/test.html")
True
>>>


-- 
Jake McKnight
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20071029/fff32301/attachment.html>


More information about the Python-list mailing list