PDA

View Full Version : Using Win XP Folder Search to Find a Word in a Python File


W. eWatson
January 28th 09, 03:35 PM
Here's a simple Python (language) file.

import Image, Tkinter

print "this"
x = 3.14

Call it simple.py, and put it in a folder. I suspect what I'm about to say
only works if you enter the above into a Python interpreted and save the
code as simple.py.

Now do a foler search for *.py and the word this. It won't find it. Try
tkinter. Same thing. Why? Does Python hash the code?
--
W. eWatson

(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

Web Page: <www.speckledwithstars.net/>

Bob I
January 28th 09, 03:53 PM
Try Agent Ransack instead. Windows won't text search in files that it
doesn't consider to be text files.

W. eWatson wrote:

> Here's a simple Python (language) file.
>
> import Image, Tkinter
>
> print "this"
> x = 3.14
>
> Call it simple.py, and put it in a folder. I suspect what I'm about to
> say only works if you enter the above into a Python interpreted and save
> the code as simple.py.
>
> Now do a foler search for *.py and the word this. It won't find it. Try
> tkinter. Same thing. Why? Does Python hash the code?

3c273
January 28th 09, 05:05 PM
Your test works fine here but I have set the
FilterFilesWithUnknownExtensions key in the registry.

-----begin reg file-----
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\ContentIndex]
"FilterFilesWithUnknownExtensions"=dword:00000001
-----end reg file-----

Google it if you are unsure what it does.
Louis

"W. eWatson" > wrote in message
...
> Here's a simple Python (language) file.
>
> import Image, Tkinter
>
> print "this"
> x = 3.14
>
> Call it simple.py, and put it in a folder. I suspect what I'm about to say
> only works if you enter the above into a Python interpreted and save the
> code as simple.py.
>
> Now do a foler search for *.py and the word this. It won't find it. Try
> tkinter. Same thing. Why? Does Python hash the code?
> --
> W. eWatson
>
> (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
> Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet
>
> Web Page: <www.speckledwithstars.net/>
>

Google