Search for a file
Thomas Guettler
guettli at thomas-guettler.de
Thu Jun 10 10:21:47 EDT 2004
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
More information about the Python-list
mailing list