Sure is.. check out the glob module:<div><br class="webkit-block-placeholder"></div><div><a href="http://www.python.org/doc/current/lib/module-glob.html">http://www.python.org/doc/current/lib/module-glob.html</a> (Official)
</div><div><a href="http://blog.doughellmann.com/2007/07/pymotw-glob.html">http://blog.doughellmann.com/2007/07/pymotw-glob.html</a> (PyMOTW)</div><div><br class="webkit-block-placeholder"></div><div><div>Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
</div><div>[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin</div><div>Type "help", "copyright", "credits" or "license" for more information.</div><div>>>> import glob
</div><div>>>> glob.glob("/var/log/*.log")</div><div>['/var/log/alf.log', '/var/log/asl.log', '/var/log/crashreporter.log', '/var/log/fsck_hfs.log', '/var/log/ftp.log', '/var/log/install.log', '/var/log/ipfw.log', '/var/log/lpr.log', '/var/log/mail.log', '/var/log/mb.log', '/var/log/netinfo.log', '/var/log/ppp.log', '/var/log/secure.log', '/var/log/system.log', '/var/log/windowserver.log', '/var/log/windowserver_last.log']
</div><div>>>> glob.glob("/var/*/*.log")</div><div>['/var/log/alf.log', '/var/log/asl.log', '/var/log/crashreporter.log', '/var/log/fsck_hfs.log', '/var/log/ftp.log', '/var/log/install.log', '/var/log/ipfw.log', '/var/log/lpr.log', '/var/log/mail.log', '/var/log/mb.log', '/var/log/netinfo.log', '/var/log/ppp.log', '/var/log/secure.log', '/var/log/system.log', '/var/log/windowserver.log', '/var/log/windowserver_last.log']
</div><div>>>> </div><div><br class="webkit-block-placeholder"></div><div>-Jeff</div><br><div><span class="gmail_quote">On 12/14/07, <b class="gmail_sendername">Vladimir Rusinov</b> <<a href="mailto:vladimir@greenmice.info">
vladimir@greenmice.info</a>> wrote:</span><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br><br>Is there any easy way to list files using bash-like patterns? Something like listfiles("/var/log/*.log"), listfiles("/var/{cache,run}/*").
<br><br>Also, I'll need something like listfiles("/tmp/**/*.tmp"), where ** is unlimited number of folders (like is zsh).
<br><br>Thanks and sorry for my English.<br clear="all"><span class="sg"><br>-- <br>Vladimir Rusinov<br>GreenMice Solutions: IT-решения на базе Linux<br><a href="http://greenmice.info/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://greenmice.info/</a>
</span><br>--<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br></blockquote>
</div><br> </div>