<div>Thank u Tim Case,</div>
<div> </div>
<div>all,</div>
<div> </div>
<div>Also how to run the standalone generated from script taking unc path names to account</div>
<div> </div>
<div>regards</div>
<div>Prakash<br><br></div>
<div class="gmail_quote">On Fri, Feb 12, 2010 at 6:31 PM, Tim Chase <span dir="ltr"><<a href="mailto:python.list@tim.thechases.com">python.list@tim.thechases.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">can any of u help to search a file say "abc.txt" in entire c drive (windows)<br>and print the path/s stating such a files presence.<br>
</blockquote><br></div>Well, you can just do it from DOS:<br><br> c:\> dir /s/b/a abc.txt<br><br>Just use os.walk() and check the list of files returned at each directory-level iteration.<br><br> ROOT = "c:\\"<br>
fname = "abc.txt".lower()<br> for p, d, f in os.walk(ROOT):<br> for fn in f:<br> if fn.lower() == fname:<br> print os.path.join(p, f)<br> # break<br><br>You might also investigate using os.path.normcase() instead of .lower()<br>
<br>-tkc<br><br><br></blockquote></div><br>