<FONT face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size=2><DIV>glob.glob() som pouzival, tu je priklad:</DIV><DIV><FONT face="Default Monospace,Courier New,Courier,monospace">-------------------- glob_example.py -----------------------------</FONT></DIV><DIV><FONT face="Default Monospace,Courier New,Courier,monospace">import glob</FONT></DIV><DIV><FONT face="Default Monospace,Courier New,Courier,monospace">masks =["*.py", "*.lsp", "*.tcl", "C:\Users\Roman\Work\Rexx\*.rex"]</FONT></DIV><DIV><FONT face="Default Monospace,Courier New,Courier,monospace">files = [file for mask in masks for file in glob.glob(mask)]</FONT></DIV><DIV>#print files</DIV><DIV><FONT face="Default Monospace,Courier New,Courier,monospace">for file in files:<BR>&nbsp; # process file<BR>&nbsp; print file<BR><DIV><FONT face="Default Monospace,Courier New,Courier,monospace">------------------------------------------------------------------</FONT></DIV></FONT></DIV><DIV>&nbsp;</DIV><DIV>Vystup napriklad u mna</DIV><DIV>&nbsp;</DIV><DIV><FONT face="Default Monospace,Courier New,Courier,monospace">C:\Users\Roman\Work&gt;glob_example.py<BR>Client.py<BR>fortran_proc.py<BR>glob_example.py<BR>pok.py<BR>pok2.py<BR>select.py<BR>Server.py<BR>input.lsp<BR>input_.lsp<BR>files.tcl<BR>pok.tcl<BR>pok_01.tcl<BR>pok_02.tcl<BR>pok_03.tcl<BR>regexp.tcl<BR>regexp2.tcl<BR>C:\Users\Roman\Work\Rexx\aktsalddat.rex<BR>C:\Users\Roman\Work\Rexx\aktsalddat01.rex<BR>C:\Users\Roman\Work\Rexx\aktsalddat02.rex<BR>C:\Users\Roman\Work\Rexx\aktsalddat_.rex<BR>C:\Users\Roman\Work\Rexx\deinstall_rxapi.rex<BR>C:\Users\Roman\Work\Rexx\password.rex<BR>C:\Users\Roman\Work\Rexx\rexx_getpass.rex<BR>C:\Users\Roman\Work\Rexx\rexx_getpass_.rex<BR></FONT></DIV><DIV>S pozdravom</DIV><DIV><BR>Roman<BR></DIV><DIV><FONT color=#990099>-----python-bounces@py.cz wrote: -----<BR><BR></DIV></FONT><BLOCKQUOTE style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">To: "Konference PyCZ" &lt;python@py.cz&gt;<BR>From: "Ondrej Beranek" &lt;rainbof@gmail.com&gt;<BR>Sent by: python-bounces@py.cz<BR>Date: 07.01.2009 13:53<BR>Subject: Re: [python] vypis adresare a podadresaru podle masky<BR><BR>ten os.walk byl dobrý tip, teď jak s tou maskou nějak "fikaně" a chytře. zatim jsem vyplodil toto: <BR><BR>import os <BR><BR>directory = {} <BR><BR>for root, dirs, files in os.walk('C:/devel/test'): <BR>&nbsp;&nbsp;&nbsp; directory[root]=files <BR><BR>print directory <BR><BR>což vytvoří zhruba to co potřebuji (potrebuju relativni cesty ale to je kosmeticka vec). No ale regularni vyraz aby umel "pozrat" hvezdickovou konvenci je na mne vysoka. Jde to udelat jinak nez modulem re ? <BR><BR><BR><DIV class=gmail_quote>Dne 7. leden 2009 13:28 Tomas Brabenec <SPAN dir=ltr>&lt; <A href="mailto:konference@brabenec.net" target=blank>konference@brabenec.net </A>&gt; </SPAN>napsal(a): <BR><BLOCKQUOTE class=gmail_quote>Ahoj, <BR><BR>ja na neco podobneho pouzivam rekurzivne volanou funkci os.listdir() <BR>Ze by nejaka funkce umela filtrovat to nevim. Pokud ale pouzijes os.listdir() s naslednym pouzitim regularniho vyrazu na vysledek, melo by to byt to co hledas. <BR><BR>Tomas <BR><BR><BR>Dne 7.1.2009 13:00, Ondrej Beranek napsal(a): <BR><BLOCKQUOTE class=gmail_quote><DIV><DIV></DIV><DIV class=Wj3C7c>Ahoj, <BR><BR>opet jsem tu s otravnou otazkou. <BR>nevite nekdo o nejake sikovne funkci ktera by podle zadane masky a adresare vratila seznam vsech souboru podle masky ? neco jako <BR><BR>dir *.txt /b /w /s <BR><BR>(nebo find ./ | grep ".txt") <BR><BR>Zkousel jsem dircache ale zda se ze je na to naprosto nevhodny navic byl ve 2.6 pythonu zastaran a ve 3 uz neni vubec. <BR><BR></DIV></DIV>------------------------------------------------------------------------ <DIV class=Ih2E3d><BR><BR>_______________________________________________ <BR>Python mailing list <BR><A href="mailto:Python@py.cz" target=_blank>Python@py.cz </A><BR><A href="http://www.py.cz/mailman/listinfo/python" target=_blank>http://www.py.cz/mailman/listinfo/python </A><BR></DIV></BLOCKQUOTE><DIV><DIV></DIV><DIV class=Wj3C7c>_______________________________________________ <BR>Python mailing list <BR><A href="mailto:Python@py.cz" target=_blank>Python@py.cz </A><BR><A href="http://www.py.cz/mailman/listinfo/python" target=_blank>http://www.py.cz/mailman/listinfo/python </A><BR></DIV></DIV></BLOCKQUOTE></DIV><BR><FONT face="Default Monospace,Courier New,Courier,monospace" size=2>_______________________________________________<BR>Python mailing list<BR>Python@py.cz<BR><A href="http://www.py.cz/mailman/listinfo/python" target=blank>http://www.py.cz/mailman/listinfo/python</A></FONT></BLOCKQUOTE><DIV><BR></DIV></FONT>