Help, *.CHM, etc
Josiah Carlson
jcarlson at uci.edu
Tue Jan 20 21:14:20 EST 2004
> A question for gui application programmers. . .
> I 've got some GUI programs, written in Python/wxPython, and I've got
> a help button and a help menu item. Also, I've got a compiled file
> made with the microsoft HTML workshop utility, lets call it
> c:\path\help.chm. My question is how do you launch it from the GUI?
> What logic do I put behind the "help" button, in other words.
>
> I thought it would be
>
> os.spawnv(os.P_DETACH, "c:\\path\\help.chm", [])
needs to be:
os.spawnv(os.P_DETACH, "c:\\path\\help.chm", ["c:\\path\\help.chm"])
> so I guess help.chm isn't executable itself, but is associated with
> some unknown executable. I tried explorer.exe- at the dos cmd line it
> basically works to type
> os.spawnv(os.P_DETACH, 'explorer.exe', ["c:\\path\\help.chm"])
os.spawnv(os.P_DETACH, 'explorer.exe', ['explorer.exe', "c:\\path\\help.chm"])
> would be equivalent but it fails. I have to believe someone out there
> in python community likes to include help.chm with their applications,
> nad there is a right way to do this.
>
> On another note, are there pure python based help viewers that people
> use instead? The reason I ask is that would be more portable then the
> *.chm files are. If there is such a beast I can't find it.
Personally, I would suggest:
os.startfile("c:\\path\\help.chm")
It is documented to do exactly what you want it to do, open up the help
file with the microsoft help file viewer.
- Josiah
More information about the Python-list
mailing list