I have a Help menu in my application that opens an “About” box that uses a wx.html.HtmlWindow in a dialog. The html text that displays contains several links, formatted as Python 2.7.3 documentation. Clicking this link opens the default browser and displays the desired page.
The problem is that I want to also link to a page on my local machine. I have a “User’s Guide” for my application, multi-page, many graphics, using a linked CSS style sheet that I want to display in the default browser as well. However, when I replace the link above with User Guide I get a “Malformed url” error dialog.
I tried to bypass the whole thing using the webbrowser module, and called webbrowser.open(’./documentation/HTMLDocs/index.html’).
That worked fine on Linux, but there is a bug in Python’s Windows implementation that renders it inoperable. And it’s Windows 7 that I need to deploy my application on.
Is there any creative trick I can try that will help me get around this catch-22? This is the very last step before I can release my application, and there are people tapping their feet at me and looking at their watches.
I have a Help menu in my application that opens an "About"
box that uses a wx.html.HtmlWindow in a dialog. The html text
that displays contains several links, formatted as ** <a
href=>Python 2.7.3
documentation** . Clicking this link opens the
default browser and displays the desired page.
The problem is that I want to also link to a page on my local
machine. I have a “User’s Guide” for my application,
multi-page, many graphics, using a linked CSS style sheet that I
want to display in the default browser as well. However, when I
replace the link above with ** User
Guide** I get a “Malformed url” error dialog.
I tried to bypass the whole thing using the webbrowser
module, and called webbrowser.open(‘./documentation/HTMLDocs/index.html’).
That worked fine on Linux, but there is a bug in Python's
Windows implementation that renders it inoperable. And it’s
Windows 7 that I need to deploy my application on.
Is there any creative trick I can try that will help me get
around this catch-22? This is the very last step before I can
release my application, and there are people tapping their feet
at me and looking at their watches.
–
You received this message because you are subscribed to the Google
Groups “wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it,
send an email to .
For more options, visit .
User
Guide
** User Guide****’ ** %
(os.path.abspath('./documentation/HTMLDocs/index.html**'))**
Well, how about that! I feel sheepish now. The first suggestion worked perfectly. In all my handwringing, I never thought to use “file” without the three slashes: ///:
Next time I’ll try to come up with something more challenging…
Thanks!
···
On Sunday, February 24, 2013 9:58:32 PM UTC-8, Gadget Steve wrote:
On 24/02/13 20:55, llanitedave wrote:
I have a Help menu in my application that opens an "About"
box that uses a wx.html.HtmlWindow in a dialog. The html text
that displays contains several links, formatted as ** <a
href=“http://docs.python.org/2/index.html” >Python 2.7.3
documentation** . Clicking this link opens the
default browser and displays the desired page.
The problem is that I want to also link to a page on my local
machine. I have a “User’s Guide” for my application,
multi-page, many graphics, using a linked CSS style sheet that I
want to display in the default browser as well. However, when I
replace the link above with ** User
Guide** I get a “Malformed url” error dialog.
I tried to bypass the whole thing using the webbrowser
module, and called webbrowser.open(‘./documentation/HTMLDocs/index.html’).
That worked fine on Linux, but there is a bug in Python's
Windows implementation that renders it inoperable. And it’s
Windows 7 that I need to deploy my application on.
Is there any creative trick I can try that will help me get
around this catch-22? This is the very last step before I can
release my application, and there are people tapping their feet
at me and looking at their watches.
–
You received this message because you are subscribed to the Google
Groups “wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it,
Eta: OK, now I’m doubly sheepish. The upper line worked fine in Linux, but did nothing in Windows. The second option gave me an error message indicating I need to tweak my display class a bit.
However, the webbrowser.open() approach DID work on windows, as long as I put it in the form webbrowser.open(“file:///” + os.path.abspath(‘documentation/HTMLDocs/index.html’))
So that’s what I’ll be going with.
···
On Monday, February 25, 2013 9:35:37 AM UTC-8, llanitedave wrote:
On Sunday, February 24, 2013 9:58:32 PM UTC-8, Gadget Steve wrote:
On 24/02/13 20:55, llanitedave wrote:
I have a Help menu in my application that opens an "About"
box that uses a wx.html.HtmlWindow in a dialog. The html text
that displays contains several links, formatted as ** <a
href=“http://docs.python.org/2/index.html” >Python 2.7.3
documentation** . Clicking this link opens the
default browser and displays the desired page.
The problem is that I want to also link to a page on my local
machine. I have a “User’s Guide” for my application,
multi-page, many graphics, using a linked CSS style sheet that I
want to display in the default browser as well. However, when I
replace the link above with ** User
Guide** I get a “Malformed url” error dialog.
I tried to bypass the whole thing using the webbrowser
module, and called webbrowser.open(‘./documentation/HTMLDocs/index.html’).
That worked fine on Linux, but there is a bug in Python's
Windows implementation that renders it inoperable. And it’s
Windows 7 that I need to deploy my application on.
Is there any creative trick I can try that will help me get
around this catch-22? This is the very last step before I can
release my application, and there are people tapping their feet
at me and looking at their watches.
–
You received this message because you are subscribed to the Google
Groups “wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it,
For more options, visit [https://groups.google.com/groups/opt_out](https://groups.google.com/groups/opt_out).
Try: User
Guide or User Guide****’ ** %
(os.path.abspath('./documentation/HTMLDocs/index.html'))**
–
Steve Gadget Barnes
Well, how about that! I feel sheepish now. The first suggestion worked perfectly. In all my handwringing, I never thought to use “file” without the three slashes: ///:
Next time I’ll try to come up with something more challenging…
I have a Help menu in my application that opens an "About" box that uses
a wx.html.HtmlWindow in a dialog. The html text that displays contains
several links, formatted as *<a
href="http://docs.python.org/2/index.html">Python 2.7.3
documentation</a>*. Clicking this link opens the default browser and
displays the desired page.
The problem is that I want to also link to a page on my local machine. I
have a "User's Guide" for my application, multi-page, many graphics,
using a linked CSS style sheet that I want to display in the default
browser as well. However, when I replace the link above with *<a
href="./documentation/HTMLDocs/index.html">User Guide</a>* I get a
"Malformed url" error dialog.
wx.html.HtmlWindow be able to load relative paths, but only as long as it knows where the current document is located in its filesystem. For example if you use LoadFile(fileName) or LoadPage(url) (with non-relative URL) then it can know where that page came from and then find relative links from there. But if you used SetPage(documentString) then there is no known location to use to make absolute paths from the relative ones.
Also, the leading "./" seems odd to me, so perhaps that is adding to the problem. Try it with just "documentation/HTMLDocs/index.html"
I tried to bypass the whole thing using the webbrowser module, and
called *webbrowser.open('./documentation/HTMLDocs/index.html').*
You will need to use a full file:// URL with the webbrowser module.