Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Search for a file

Reply
Thread Tools

Search for a file

 
 
mithuna g
Guest
Posts: n/a
 
      06-10-2004
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


---------------------------------
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger
 
Reply With Quote
 
 
 
 
Thomas Guettler
Guest
Posts: n/a
 
      06-10-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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Google search result like site search!! How? =?Utf-8?B?TGFrc2htaSBOYXJheWFuYW4uUg==?= ASP .Net 3 05-06-2005 02:08 AM
removing search engines from the search bar whatever.or.not@gmail.com Firefox 1 02-17-2005 12:06 PM
Search Bar not displaying search Engines Zimran Douglas Firefox 1 01-07-2005 02:30 PM
search within a search within a search - looking for better way...my script times out Abby Lee ASP General 5 08-02-2004 04:01 PM



Advertisments