On 20 April 2010 03:25, Tino Dai wrote:
> If I have:
>
> import re
> a=re.compile('foo')
>
> is there a way to get the original pattern of foo from the object a?
>
> Thanks,
> Tino
>
>
> ___
> Tutor maillist - tu...@python.org
> To unsubscribe or chang
If I have:
import re
a=re.compile('foo')
is there a way to get the original pattern of foo from the object a?
Thanks,
Tino
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tu
Thanks!
On Sat, Apr 17, 2010 at 1:32 PM, Jim Byrnes wrote:
> Matthew Carpenter-Arevalo wrote:
>
>> Hi Everyone,
>>
>> I'm a beginner python programmer, and I've been working on
>> the perennial 'guess my number' example.
>>
>> When I run this in my module, I get an infinite loop of 'higher' or
Spir sent this solely to me by accident, I think.
-- Forwarded message --
From: spir ☣
Date: 2010/4/19
Subject: Re: [Tutor] List index usage: is there a more pythonesque way?
To: cmca...@googlemail.com
On Mon, 19 Apr 2010 12:59:40 +0100
C M Caine wrote:
> That's the first I'v
On Mon, Apr 19, 2010 at 9:23 AM, Alan Gauld wrote:
>
> "C M Caine" wrote
>
>> That's the first I've read of iterating through dictionaries, I'd
>>
>> assumed it was impossible because they're unordered.
>>
>
> Iteration doesn't require order, only to get each item once.
> Even in very old Python
"C M Caine" wrote
That's the first I've read of iterating through dictionaries, I'd
assumed it was impossible because they're unordered.
Iteration doesn't require order, only to get each item once.
Even in very old Python versions you could iterate a dictionary
via the keys() method. More
That's the first I've read of iterating through dictionaries, I'd
assumed it was impossible because they're unordered. Your explanation
for defining your own iterables is much easier to understand than the
one I read before as well.
Thanks again.
2010/4/19 spir ☣ :
> On Mon, 19 Apr 2010 00:37:11
On Mon, 19 Apr 2010 00:37:11 +0100
C M Caine wrote:
> That's two new things I've learnt. I didn't realise that for loops
> could be used like that (with more than one... key?).
Consider considering things differently: a for loop always iterates over items
of a collection you indicate:
l = [1,2
> That's two new things I've learnt. I didn't realise that for loops
> could be used like that (with more than one... key?).
Technically its still one key but enumerate returns a tuple
of index and value and we use tuple unpacking to assign
the values to the loop variables. That is we could writ