On Sat, Nov 28, 2009 at 6:15 PM, Michael Hannon wrote:
> Greetings. While looking into the use of regular expressions in Python, I
> saw that it's possible to name match groups using:
>
> (?P...)
>
> and then refer to them using:
>
> (?P=name)
>
> I was able to get this to work in the foll
Michael Hannon wrote:
> Greetings. While looking into the use of regular expressions in Python, I
> saw that it's possible to name match groups using:
>
> (?P...)
>
> and then refer to them using:
>
> (?P=name)
I'm not sure you've got that quite right. IIUC, the (?P=name) syntax is
us
Greetings. While looking into the use of regular expressions in Python, I saw
that it's possible to name match groups using:
(?P...)
and then refer to them using:
(?P=name)
I was able to get this to work in the following, nonsensical, example:
>>> x = 'Free Fri Fro From'
>>>
On 11/27/2009 7:03 PM, Stefan Lesicnik wrote:
hihi! (two in 1 day!)
Is there a document, pep, wiki etc that defines best practice for python code?
(maybe its more generic).
PEP 8 is the official style guideline.
I keep stumbling on things I think, it would be nice if someone mentioned thi
2009/11/28 Wayne Werner :
>
>
> On Sat, Nov 28, 2009 at 6:59 AM, Dave Angel wrote:
>>
>> And if the lists are large, use itertools.izip() which works the same,
>> but produces an iterator.
>>
>> Note that if the lists are not the same length, I think it stops when the
>> shorter one ends.
>
> But
- "Sander Sweers" wrote:
> 2009/11/27 Stefan Lesicnik :
> > s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> > #s.setdefaulttimeout(1)
> > s.connect((proxy,port))
>
> I have never used socket but a quick look at the docs [1] my guess is
> that you should use use s.settimeout() [2
Hi, I would like to use the GNU linear programming kit, preferably with
Python and under Windows. After some googling I found python-glpk and
ctypes-glpk. The later seems to be an alternative but I get a feeling that
the former is the one most people recommend (also, I'm not sure that it will
work
On Sat, Nov 28, 2009 at 6:59 AM, Dave Angel wrote:
>
> And if the lists are large, use itertools.izip() which works the same, but
> produces an iterator.
>
> Note that if the lists are not the same length, I think it stops when the
> shorter one ends.
>
But you can use izip_longest:
import ite
Jose Amoreira wrote:
Hi!
I want to process corresponding elements of two lists, sequentially. Call the
lists list1 and list2, and assume they have equal lengths. I can do something
like
for index in range(len(list1)):
process(list1[index], list2[index])
But I find it somehow rather ugly,
On 11/28/2009 10:03 PM, Jose Amoreira wrote:
Yes, Robert, that does it! Thanks a lot!
Have a nice weekend!
Jose
don't forget zip() built-in function:
for x, y in zip(list1, list2):
print x, y
___
Tutor maillist - Tutor@python.org
To unsubscrib
Hi!
I want to process corresponding elements of two lists, sequentially. Call
the
lists list1 and list2, and assume they have equal lengths. I can do
something
like
for index in range(len(list1)):
process(list1[index], list2[index])
But I find it somehow rather ugly, because we generate yet
Yes, Robert, that does it! Thanks a lot!
Have a nice weekend!
Jose
On Saturday 28 November 2009 10:54:56 am Robert Johansson wrote:
> Hi!
> I want to process corresponding elements of two lists, sequentially. Call
> the
> lists list1 and list2, and assume they have equal lengths. I can do
> someth
Hi!
I want to process corresponding elements of two lists, sequentially. Call the
lists list1 and list2, and assume they have equal lengths. I can do something
like
for index in range(len(list1)):
process(list1[index], list2[index])
But I find it somehow rather ugly, because we generate yet
13 matches
Mail list logo