On Tue, 29 Sep 2009 19:09:16 -0700 (PDT), chad <cdal...@gmail.com> wrote: > I have a directory that contains the following > > login > rc > sum > _1 > _2 > _3 > _4 > > What's the sanest way to print out all the files in the directory that > start with the underscore? Ie, I just want to list _1, _2, _3, _4.
I don't know what you mean by "sanest", but this is one way: import glob for f in glob.glob("_*"): print f Martien -- | Martien Verbruggen | You can't have everything, where would first.l...@heliotrope.com.au | you put it? | -- http://mail.python.org/mailman/listinfo/python-list