"James" <[EMAIL PROTECTED]> wrote
> I have a dumb question...hopefully someone can shed some light on
> the
> difference between for and while in the situation below.
You got the basic answer but I'll just add a comment.
while is your basic type loop, same as in C and most other languages.
for
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Try:
for item in stuff:
os.system(item[0])
print item[1]
Alternativly:
for cmd, msg in stuff:
os.system(cmd)
print msg
Andreas
James wrote:
> All,
>
> I have a dumb question...hopefully someone can shed some light on the
> diffe
I shiver at the thought of Perl. ;)
Thanks to everyone for your quick and helpful responses!
.james
On Sep 28, 2007, at 11:25 AM, Kent Johnson wrote:
> James wrote:
>> Great! I was under the impression that the range was implied, but
>> I guess not. ;)
>
> No. One of the core Python value
James wrote:
> Great! I was under the impression that the range was implied, but I
> guess not. ;)
No. One of the core Python values is "Explicit is better than implicit."
If you like implicit behaviour, try Perl ;-)
Type 'import this' at the Python prompt for more...
Kent
_
On 9/28/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
>
>
> It's worth your time learning about Python data structures and for
> loops. They are very powerful and useful and unlike anything built-in to
> C. With a background in C you should find the official tutorial pretty
> easy to read:
> http://d
On 9/28/07, James <[EMAIL PROTECTED]> wrote:
>
>
> # doesn't work
> for i in len( stuff ):
> os.system( stuff[ i ] )
> j = i + 1
> print stuff[ j ]
>
>
> Traceback (most recent call last):
>File "", line 1, in
> TypeError: 'int' o
James wrote:
> All,
>
> I have a dumb question...hopefully someone can shed some light on the
> difference between for and while in the situation below.
>
> I'm trying to iterate through a list I've created. The list consists
> of a command, followed by a 'logging' message (a message printed
On Sep 28, 2007, at 10:59 AM, bob gailer wrote:
> James wrote:
>> All,
>>
>> I have a dumb question...hopefully someone can shed some light on
>> the difference between for and while in the situation below.
>>
>> I'm trying to iterate through a list I've created. The list
>> consists of a c
On 9/28/07, James <[EMAIL PROTECTED]> wrote:
>
> All,
>
> I have a dumb question...hopefully someone can shed some light on the
> difference between for and while in the situation below.
>
> I'm trying to iterate through a list I've created. The list consists
> of a command, followed by a 'logging
James wrote:
> All,
>
> I have a dumb question...hopefully someone can shed some light on the
> difference between for and while in the situation below.
>
> I'm trying to iterate through a list I've created. The list consists
> of a command, followed by a 'logging' message (a message printed t
All,
I have a dumb question...hopefully someone can shed some light on the
difference between for and while in the situation below.
I'm trying to iterate through a list I've created. The list consists
of a command, followed by a 'logging' message (a message printed to a
console or log file
11 matches
Mail list logo