Tim Chase wrote:
> If you're doing more processing than just printing it, your
> for-loop is a better (clearer) way to go. If you have lots of
> processing code, it might help to do the inverse:
>
> for filename in os.listdir(location):
> if not filename.startswith('_'): continue
> l
Rami Chowdhury
"Never attributed to malice that which can be attributed to stupidity." --
Hanlon's Razor
408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD)
On Tuesday 29 September 2009 19:54:17 chad wrote:
> On Sep 29, 7:52 pm, chad wrote:
> > On Sep 29, 7:20 pm, Tim Chase wrote:
import os
for filename in os.listdir("/usr/bbs/confs/september"):
#stat = os.stat(filename)
if filename.startswith("_"):
print filename
yes, as lallous mentioned, this can be done as a
list-comprehension/generator. If printing is all you want to do,
it's a nice and concise
"chad" wrote in message
news:4e260ef3-8b0e-4613-a4f8-1c267e875...@u16g2000pru.googlegroups.com...
On Sep 29, 7:20 pm, Tim Chase wrote:
> 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'd use a string
On Tue, 29 Sep 2009 19:09:16 -0700 (PDT),
chad 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
On Sep 29, 7:52 pm, chad wrote:
> On Sep 29, 7:20 pm, Tim Chase wrote:
>
> > > 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'd use a string's join() method to combine the results of a
> > lis
On Sep 29, 7:20 pm, Tim Chase wrote:
> > 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'd use a string's join() method to combine the results of a
> list-comprehension or generator that filtered th
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'd use a string's join() method to combine the results of a
list-comprehension or generator that filtered the output of
os.listdir() based on the startswit
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.
--
http://mail.python.org/mailman/listinfo/python-list