perfect but can you give me a link to find a file in a directory.Because i do not the function to search files in some directory. Can you give an example :<br><br>
<div><span class="gmail_quote">On 7/4/07, <b class="gmail_sendername">Alan Gauld</b> <<a href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>"Alejandro Decchi" <<a href="mailto:adecchi@gmail.com">adecchi@gmail.com</a>> wrote<br>
<br>> Is the word or part of the word that the user enters in the texbox .<br>> And this word is the name of the file to be found<br><br>Ok, In that case use the glob function in the glob module.<br>It returns a list of all files that match a pattern:
<br><br>>>> import glob<br>>>> files = glob.glob("*.txt")<br>>>> print files<br><br>For more powerful searches you can use os.walk()<br><br>See the OS topic in my tutorial for more examples of
<br>using glob and os.walk<br><br>HTH,<br><br>--<br>Alan Gauld<br>Author of the Learn to Program web site<br><a href="http://www.freenetpages.co.uk/hp/alan.gauld">http://www.freenetpages.co.uk/hp/alan.gauld</a><br><br><br>
_______________________________________________<br>Tutor maillist - <a href="mailto:Tutor@python.org">Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor
</a><br></blockquote></div><br>