On Wed, Jul 15, 2009 at 8:29 AM, Rich Lovely<[email protected]> wrote:
> 2009/7/15 vince spicer <[email protected]>:
>> :
>> import re
>> :
>> values = re.split("\s+", line) # split values on spaces EX: ['47', '8',
>
> That isn't what they're after at all.
> Something more like
> :
> n, pos, ala, at, symb, weight, rad, count = line.split()
> :
on a side note, i also discourage the use of regular expressions for
this problem when a simpler solution like line.split() will suffice.
bringing up an old jwz quote: 'Some people, when confronted with a
problem, think “I know, I'll use regular expressions.” Now they have
two problems.'
best regards,
-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python Programming", Prentice Hall, (c)2007,2001
"Python Fundamentals", Prentice Hall, (c)2009
http://corepython.com
wesley.j.chun :: wescpy-at-gmail.com
python training and technical consulting
cyberweb.consulting : silicon valley, ca
http://cyberwebconsulting.com
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor