Re: Filename case-insensitivity on OS X

2006-01-03 Thread Doug Schwarz
File System". Use Disk Utility to create a disk image and then erase it (again, using Disk Utility) and put UFS on it. You'll find that "touch foo FOO" will create two files. -- Doug Schwarz dmschwarz&urgrad,rochester,edu Make obvious changes to get real email address. -- http://mail.python.org/mailman/listinfo/python-list

Re: Some more odd behaviour from the Regexp library

2005-10-19 Thread Doug Schwarz
x27;exit: (.*?)', a) > In [4]: b.group(0) > Out[4]: 'exit: ' > > In [5]: b.group(1) > Out[5]: '' > > In [6]: b.group(2) > IndexError: no such group The ? tells (.*?) to match as little as possible and that is nothing. If you change it to (.*) it should

Re: Favorite non-python language trick?

2005-06-24 Thread Doug Schwarz
> dash. This is much nicer than in C or Python having to get rid of """ or > > /* and */. Of course, the IDE can compensate. But it's still neat :) > > python: > > """ > print 10 > """ > > and > > #"

Re: Regex for repeated character?

2005-06-17 Thread Doug Schwarz
does? In other words, I want a > pattern like this: > > >>> re.findall(".+", "foo") # not what I want > ['foo'] > >>> re.findall("something", "foo") # what I want > ['f', 'oo'] How's this?

Re: Compute pi to base 12 using Python?

2005-04-13 Thread Doug Schwarz
iven by f(n+1) = f(n) * 2^(1/12) so by the time you go all 12 notes in an octave you have doubled the frequency. There is nothing here involving base 12 or pi. -- Doug Schwarz dmschwarz&urgrad,rochester,edu Make obvious changes to get real email address. -- http://mail.python.org/mailman/listinfo/python-list

Re: String Splitter Brain Teaser

2005-03-28 Thread Doug Schwarz
, ['T'], ['A', 'G']] How about this? import re s = "ATT/GATA/G" result1 = re.findall(r"./.|.", s) consensus = [c.split("/") for c in result1] -- Doug Schwarz dmschwarz&urgrad,rochester,edu Make obvious changes to get real email address. -- http://mail.python.org/mailman/listinfo/python-list

Re: String Splitter Brain Teaser

2005-03-28 Thread Doug Schwarz
, ['T'], ['A', 'G']] How about this? import re s = "ATT/GATA/G" result1 = re.findall(r"./.|.", s) consensus = [c.split("/") for c in result1] -- Doug Schwarz dmschwarz&urgrad,rochester,edu Make obvious changes to get real email address. -- http://mail.python.org/mailman/listinfo/python-list

Re: String Splitter Brain Teaser

2005-03-27 Thread Doug Schwarz
, ['T'], ['A', 'G']] How about this? import re s = "ATT/GATA/G" result1 = re.findall(r"./.|.", s) consensus = [c.split("/") for c in result1] -- Doug Schwarz dmschwarz&urgrad,rochester,edu Make obvious changes to get real email address. -- http://mail.python.org/mailman/listinfo/python-list

Re: programmatically calling a function

2005-03-05 Thread Doug Schwarz
In article <[EMAIL PROTECTED]>, Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote: > Doug Schwarz wrote: > > > Dave, > > > > I think eval might be what you're looking for: > > > > f = eval('len') > > length = f([1,2,3]) >

Re: programmatically calling a function

2005-03-05 Thread Doug Schwarz
nt 'bar' > > > i'd really appreciate any help the 'group' has to offer. > > > thanks > dave Dave, I think eval might be what you're looking for: f = eval('len') length = f([1,2,3]) By the way, are you the Dave Ekhaus I used to work with at Kodak? -- Doug Schwarz dmschwarz&urgrad,rochester,edu Make obvious changes to get real email address. -- http://mail.python.org/mailman/listinfo/python-list