[Python-Dev] Re: HTMLHelp for Py2.3.1

Thomas Heller theller at python.net
Tue Sep 16 13:45:40 EDT 2003


"Boriz Izaguirre" <hernan at orgmf.com.ar> writes:

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

It seems this patch is already applied in 2.3.

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

I know this, and how to do the windows side. What I meant was that I
don't know enough about IDLE (or Tkinter) to implement the functionality
to find the word under the cursor.

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

I don't think win32all wraps the HTMLHelp api, does it?
OTOH, I'm waiting for a reason to include ctypes with core python ;-)


> Regards,
> -Hernan
>

Thomas




More information about the Python-Dev mailing list