George Sakkis wrote:
>
> If by 'rooted' you mean old enough, so is 'goto'...
I was meaning a sort of (very) old style of programming. In fact I wrote
some few hundreds lines on my own, but probably memory was much better
the :)
> will
> thank yourself for doing so if you have to go back at th
Maric Michaud wrote:
> Le Samedi 10 Juin 2006 17:44, TheSaint a écrit :
> devices = [ e for e in devices if e.split('/')[-1] in partitions ]
This is _not_ the expected result :)
is missing a not as :
devices = [ e for e in devices if e.split('/')[-1] *not* in partitions ]
>> if len(c) != 1:
>>
TheSaint wrote:
> Maric Michaud wrote:
>
> > Le Samedi 10 Juin 2006 17:44, TheSaint a écrit :
>
> >>
> > begin using more explicit variable names.
>
> Frankly it's a very rooted way of programming, since C64 basic :-)
If by 'rooted' you mean old enough, so is 'goto'... Except perhaps for
iteratio
TheSaint wrote:
> A part of this, how python catch variables, the longer the slower, isn't it?
nope.
--
http://mail.python.org/mailman/listinfo/python-list
Maric Michaud wrote:
> Le Samedi 10 Juin 2006 17:44, TheSaint a écrit :
>>
> begin using more explicit variable names.
Frankly it's a very rooted way of programming, since C64 basic :-)
A part of this, how python catch variables, the longer the slower, isn't it?
Even supposing to use a set of s
Le Samedi 10 Juin 2006 17:44, TheSaint a écrit :
> Hello!
>
Hi,
> Is there a more pythonic way to implement the following program:
I'll try to make some suggestions.
>
> 8<--8<--8<--8<--
>
> #! /usr/bin/env python
>
> import os
> import sys
> a = os.l
TheSaint <[EMAIL PROTECTED]> writes:
> # Filling the c with the list of devices which are recorded to be mounted
>
> d = filter((lambda a: a[:2] =='/d'),mnt.readlines()) # non /dev-mounts are
> off
> d = map((lambda a: a.split()[:1]),d) # only the first info column is used
Just focusing one one
Hello!
Is there a more pythonic way to implement the following program:
8<--8<--8<--8<--
#! /usr/bin/env python
import os
import sys
a = os.listdir('/media')
# no mount dirs were found, exit nicely
if len(a) == 0:
sys.exit(0)
# Maybe co