[Tutor] Searching across .Py files for a particular string/ character

2006-03-30 Thread Janesh Ramakrishnan

Hi Folks,

I was wondering what would be the best way to look up a string across different 
files in the Python interpreter (PythonWin 2.4). The find function only finds 
files within currently open files. If I have a folder of .py scripts and need 
to look up a specific keyword or string among all these files within the 
project folder, is there any method that you'd recommend?

For eg: Visual Studio 6.0 can look for a string across numerous files indexed 
in a project and returns a list of files containing that specific string. 

Any help would be greatly appreciated.

Thanks.
Janesh



___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Tutor Digest, Vol 25, Issue 83

2006-04-06 Thread Janesh Ramakrishnan
Hi Kent:

Thanks for your response. The Grep function does a really good job of searching 
across .py files in a directory or subdirectories for the specific 
keyword/string. 

In the PythonWin interpreter 2.1, Go to File -> New -> Grep and the search 
string can be entered. It is useful in searching strings across multiple files, 
especially in large projects.

~Janesh


Message: 1
Date: Thu, 30 Mar 2006 21:22:39 -0500
From: Kent Johnson <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Searching across .Py files for a particular
string/ character
Cc: tutor@python.org
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Janesh Ramakrishnan wrote:
> Hi Folks,
> 
> I was wondering what would be the best way to look up a string across
> 
different files in the Python interpreter (PythonWin 2.4). The find
function only finds files within currently open files. If I have a
folder of .py scripts and need to look up a specific keyword or string
among all these files within the project folder, is there any method
that you'd recommend?

I would do that in my editor, probably. But Python can get a list of 
files in a directory with os.listdir(). Loop over the files, use 
os.path.join() to make a full path, open the file, read the data, look 
for the string in the data.

Kent

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Beep Beep sound sometimes while running PythonWin (Python 2.1)

2006-05-11 Thread Janesh Ramakrishnan

Hi Folks:

Has anyone of you experienced this beep - beep sound from the deskstation CPU 
when Python crashes? It apparently has happened a few times when I was running 
some .py scripts in PythonWin. The scripts do not play any audio files. I then 
have to reboot the CPU to get the system up and running again.

Would appreciate any input you may have on this issue.

Thanks.
J.Ramakrishnan

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor