HTMLHelp for Py2.3.1 (Was: Re: [Python-Dev] Py2.3.1) (original) (raw)

Boriz Izaguirre hernan at orgmf.com.ar
Sun Sep 7 16:52:36 EDT 2003


[Thomas]

[Fred L. Drake]

IDLE currently looks for the index.html file in a few places (which depend on platform); if it can't find it, it uses the documentation on python.org.

It should be too hard to change it to load the HTML Help viewer if it finds the .chm file on Windows, and to still fall back to the HTML or the online documentation if the .chm can't be found. Changing it is trivial, EditorWindow.helpurl must point to Python23.chm (if it exists). I can do this.

Beware that for .html you want webbrowser.open(url) and for .chm you want os.startfile(url) There used to be a patch in Idle-dev for this. http://tinyurl.com/mj1s

Even nicer would be context-sensitive keyword help, but it seems IDLE doesn't support it, right?

Standard .chm format already includes useful index data to do context-sensitive search. A couple of years ago I made an Idle extension to manage this. It wasn't difficult then, and I think it's even easier now. The problem I found is that you pass the selected text (the one you are looking for) to HTMLHelp system by calling a Win32 API. You'll need win32all installed. That's the way PythonWin works, by the way. I guess this makes it a no-no for standard Python, right?

Regards, -Hernan



More information about the Python-Dev mailing list