Re: How simputer COULD HAVE succeeded ?
> PS. before investing time in Python, I wanted to find out if it > can interface low-level, by eg. calling the OS or C...etc. > eg. could it call linux's "dd if=.." ? In python you have full access to the shell, and excellent interoperability with c. -Mike -- http://mail.python.org/mailman/listinfo/python-list
Regex anomaly
Hello, Has anyone has issue with compiled re's vis-a-vis the re.I (ignore case) flag? I can't make sense of this compiled re producing a different match when given the flag, odd both in it's difference from the uncompiled regex (as I thought the uncompiled api was a wrapper around a compile-and-execute block) and it's difference from the compiled version with no flag specified. The match given is utter nonsense given the input re. In [48]: import re In [49]: reStr = r"([a-z]+)://" In [51]: against = "http://www.hello.com"; In [53]: re.match(reStr, against).groups() Out[53]: ('http',) In [54]: re.match(reStr, against, re.I).groups() Out[54]: ('http',) In [55]: reCompiled = re.compile(reStr) In [56]: reCompiled.match(against).groups() Out[56]: ('http',) In [57]: reCompiled.match(against, re.I).groups() Out[57]: ('tp',) cheers, -Mike -- http://mail.python.org/mailman/listinfo/python-list
Re: Regex anomaly
Thanks guys, that is probably the most ridiculous mistake I've made in years -Mike -- http://mail.python.org/mailman/listinfo/python-list
Re: for: else: - any practical uses for the else clause?
On 9/29/06, Johan Steyn <[EMAIL PROTECTED]> wrote: > On 29 Sep 2006 11:26:10 -0700, Klaas <[EMAIL PROTECTED]> wrote: > > > else: does not trigger when there is no data on which to iterate, but > > when the loop terminated normally (ie., wasn't break-ed out). It is > > meaningless without break. > > The else clause *is* executed when there is no data on which to iterate. > Your example even demonstrates that clearly: Yes--there is a missing "just" in that sentence. -Mike -- http://mail.python.org/mailman/listinfo/python-list