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> &lt;<a href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>&quot;Alejandro Decchi&quot; &lt;<a href="mailto:adecchi@gmail.com">adecchi@gmail.com</a>&gt; wrote<br>
<br>&gt; Is the word or part of the word that the user enters in the texbox .<br>&gt; 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>&gt;&gt;&gt; import glob<br>&gt;&gt;&gt; files = glob.glob(&quot;*.txt&quot;)<br>&gt;&gt;&gt; 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&nbsp;&nbsp;-&nbsp;&nbsp;<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>