problem opening html file with webbrowser.open

K

krishnakant Mane

hello all,
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.
any ways I am right now doing the hamd coding myself. may be I have
overlooked some module.
right now I am in the process of trying templayer.
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.
there is certainly some thing wrong in what I am giving to the open function.
can some one correct me?
regards,
Krishnakant.
 
P

Paul Boddie

hello all,
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.
any ways I am right now doing the hamd coding myself. may be I have
overlooked some module.
right now I am in the process of trying templayer.

This somewhat neglected Wiki page may provide some guidance:

http://wiki.python.org/moin/Templating

Dynamically styling data can be somewhat awkward, and I'd probably
have some kind of last-minute transformation on my data to add
presentation-related attributes and then feed it to a generic
templating system.
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.
there is certainly some thing wrong in what I am giving to the open function.
can some one correct me?

Which system and Web browser are you using? Perhaps you'd be
interested in the desktop module instead:

http://www.python.org/pypi/desktop

Paul
 
S

Stefan Behnel

krishnakant said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top