Win32 documentation in CHM?

Anton Vredegoor anton at vredegoor.doge.nl
Mon Sep 1 00:19:16 CEST 2003


"Tim Peters" <tim.one at comcast.net> wrote:

>You cannot have used a properly constructed .chm file and seriously question
>whether it's more searchable.  Of course it is, including seemingly
>instantaneous Boolean, proximity, wildcard, and similarity searches, across
>the entire doc set with one query.  I don't know of any way to search thru
>more than a thousand .html files that's even arguably comparable; e.g., grep
>is a slow & painful joke in comparison.

OTOH this seems like a job for a Python script. It should be possible
to do a search that locates all positions for all words in all files
(maybe the files can be in a zipped archive) and store the result in a
pickle. Probably what's needed is a dictionary and a list of file
paths:

the file path list( f.e. generated by a recursive path walk):

[file1,file2, ....]


the dictionary:

{"python" : [(1,3),(1,18),(26,5)], "dictionary": [(3,5),...]}

Where the first tuple (1,3) means the word "python" appears in the
file that's in the file path list at index 1, at position 3 in the
file.

Next time open the pickle and do not repeat the whole search.

Two problems:

- what should the -tkinter?- user interface look like?
- how to do an ascii-like search in a set of html-files (necessary for
displaying the found lines in a tkinter widget) and still return a
link for webbrowser.open("filename") with an offset to the found word
position after the item is clicked, selected or whatever.

One brainstorming idea:

- maybe a split window with a tree-like structure in the left (the
tree is pruned for the search term) and in the right a list of
clickable lines from the selected files in the tree.

Anton




More information about the Python-list mailing list