Re: regex question

2007-04-28 Thread proctor
On Apr 27, 8:26 am, Michael Hoffman <[EMAIL PROTECTED]> wrote: > proctorwrote: > > On Apr 27, 1:33 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > >> On Apr 27, 1:33 am,proctor<[EMAIL PROTECTED]> wrote: > >>> rx_test = re.compile('/x([^x]

Re: regex question

2007-04-27 Thread proctor
On Apr 27, 8:50 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Apr 27, 9:10 am, proctor <[EMAIL PROTECTED]> wrote: > > > > > On Apr 27, 1:33 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > > > > On Apr 27, 1:33 am, proctor <[EMAIL PROTECTED

Re: regex question

2007-04-27 Thread proctor
On Apr 27, 8:37 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > proctor <[EMAIL PROTECTED]> wrote: > > so my question remains, why doesn't the star quantifier seem to grab > > all the data. isn't findall() intended to return all matches? i > > would expec

Re: regex question

2007-04-27 Thread proctor
On Apr 27, 8:26 am, Michael Hoffman <[EMAIL PROTECTED]> wrote: > proctor wrote: > > On Apr 27, 1:33 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > >> On Apr 27, 1:33 am, proctor <[EMAIL PROTECTED]> wrote: > >>> rx_test = re.compile('/x([^x]

Re: regex question

2007-04-27 Thread proctor
On Apr 27, 1:33 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Apr 27, 1:33 am, proctor <[EMAIL PROTECTED]> wrote: > > > > > hello, > > > i have a regex: rx_test = re.compile('/x([^x])*x/') > > > which is part of this test program: >

regex question

2007-04-26 Thread proctor
isn't the 'star' grabbing the whole group? and why isn't each letter 'a', 'b', and 'c' present, either individually, or as a group (group is expected)? any clarification is appreciated! sincerely, proctor -- http://mail.python.org/mailman/listinfo/python-list

Re: recursion depth problem

2007-04-23 Thread proctor
f-documenting part of the code should be more like this: print ' ' * 13 + '%s * (2 ** %s)' % (a, width-1) instead of print ' ' * 13 + '%s * (2 ** %s)' % (a, width) is this correct, or am i mixed? sincerely, proctor -- http://mail.python.org/mailman/listinfo/python-list

Re: recursion depth problem

2007-04-22 Thread proctor
my method unredeemable? > > > Let's just say that I don't currently see an obvious way of redeeming > > it. ;-) > > Change the outer if into a while, and the recursive calls into proper > assignments to n. They're both tail-recursive calls, so this won't > change the semantics, as it happens. > > Alex really helpful! thank you very much! proctor. -- http://mail.python.org/mailman/listinfo/python-list

Re: recursion depth problem

2007-04-22 Thread proctor
On Apr 22, 9:28 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 22 Apr 2007 19:13:31 -0700, proctor <[EMAIL PROTECTED]> declaimed the > following in comp.lang.python: > > > > > :-) > > > this is good stuff. for learning especially! thank you ag

Re: recursion depth problem

2007-04-22 Thread proctor
On Apr 22, 7:34 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > proctor wrote: > > On Apr 22, 2:06 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > >> proctor wrote: > >>> On Apr 22, 1:24 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: > >>

Re: recursion depth problem

2007-04-22 Thread proctor
On Apr 22, 7:10 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 22 Apr 2007 17:06:18 -0700, proctor <[EMAIL PROTECTED]> declaimed the > following in comp.lang.python: > > > > else: > > > # only one of carry in, b1, or b2 is set > >

Re: recursion depth problem

2007-04-22 Thread proctor
On Apr 22, 5:51 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Sun, 22 Apr 2007 17:37:05 -0500, Michael Bentley > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > Anything that can be done with recursion can be done without > > recursion. If you really wanted to mimic

Re: recursion depth problem

2007-04-22 Thread proctor
- 1, -1, -1)]: > a = val / i > print ' ' * 13 + '%s * (2 ** %s)' % (a, width) > val -= i * a > width -= 1 > > binary(233, 8) very cool. thanks a lot michael. very interesting. proctor. -- http://mail.python.org/mailman/listinfo/python-list

Re: recursion depth problem

2007-04-22 Thread proctor
t;xselections" function uses a for loop on the page: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/190465 ? or are you referring to a different technique for this? thanks for your help. i really appreciate it. proctor. -- http://mail.python.org/mailman/listinfo/python-list

Re: recursion depth problem

2007-04-22 Thread proctor
On Apr 22, 4:37 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: > On Apr 22, 2007, at 4:08 PM, proctor wrote: > > > > > On Apr 22, 2:55 pm, [EMAIL PROTECTED] wrote: > >> On Apr 22, 11:49 am, proctor <[EMAIL PROTECTED]> wrote: > > >>> hell

Re: recursion depth problem

2007-04-22 Thread proctor
On Apr 22, 2:06 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > proctor wrote: > > On Apr 22, 1:24 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: > >> On Apr 22, 2007, at 1:49 PM, proctor wrote: > > >>> i have a small function which mimics binary count

Re: recursion depth problem

2007-04-22 Thread proctor
On Apr 22, 2:55 pm, [EMAIL PROTECTED] wrote: > On Apr 22, 11:49 am, proctor <[EMAIL PROTECTED]> wrote: > > > > > hello, > > > i have a small function which mimics binary counting. it runs fine as > > long as the input is not too long, but if i give it inpu

Re: recursion depth problem

2007-04-22 Thread proctor
On Apr 22, 1:24 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: > On Apr 22, 2007, at 1:49 PM, proctor wrote: > > > > > i have a small function which mimics binary counting. it runs fine as > > long as the input is not too long, but if i give it input longer

recursion depth problem

2007-04-22 Thread proctor
ut a list of permutations like this: $ python test-bin.py 1000 0100 1100 0010 1010 0110 1110 0001 1001 0101 1101 0011 1011 0111 thanks for all help! sincerely, proctor -- http://mail.python.org/mailman/listinfo/python-list

Re: regex question

2007-01-08 Thread proctor
Paul McGuire wrote: > "proctor" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > > > > it does work now...however, one more question: when i type: > > > > rx_a = re.compile(r'a|b|c') > > it works correctly! &g

Re: regex question

2007-01-08 Thread proctor
string) yes, i suppose you are right. i can't think of a reason i would NEED a raw string in this situation. all very helpful! thanks very much. sincerely, proctor. -- http://mail.python.org/mailman/listinfo/python-list

Re: regex question

2007-01-08 Thread proctor
Steven D'Aprano wrote: > On Sun, 07 Jan 2007 23:57:00 -0800, proctor wrote: > > > it does work now...however, one more question: when i type: > > > > rx_a = re.compile(r'a|b|c') > > it works correctly! > > > > shouldn't: > > r

Re: regex question

2007-01-08 Thread proctor
Paul McGuire wrote: > "proctor" <[EMAIL PROTECTED]> wrote in message > news:<[EMAIL PROTECTED]>... > > hello, > > > > i hope this is the correct place... > > > > i have an issue with some regex code i wonder if you have any insight: &g

regex question

2007-01-07 Thread proctor
;, line 21, in ? i = rx_a.search(stg).start() AttributeError: 'NoneType' object has no attribute 'start' = i am fairly new to this, and can't see the reason for the error. what am i missing? btw, i think there are simpler ways to go about this, but i am