Search for a file

M

mithuna g

Hi All,

I am new user of python. I would like to have your suggestions to do a task.

Given a file name say a.c, is there any possiblity that will help in finding the location of the file.

Thanks,
mithuna
 
T

Thomas Guettler

Am Thu, 10 Jun 2004 02:33:15 -0700 schrieb mithuna g:
Hi All,

I am new user of python. I would like to have your suggestions to do a task.

Given a file name say a.c, is there any possiblity that will help in
finding the location
of the file.

Hi,

If you use unix try "locate". If locate
is not installed, try "find / -name 'a.c'"

If you want to do this in python, have
a look at os.listdir(). You need a recursive
function since you want to search in sub-directories,
too.

Or try os.path.walk()

Regards,
Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top