[Tutor] str.split and quotes

Marilyn Davis marilyn at deliberate.com
Wed Apr 6 07:19:16 CEST 2005


Hi Tutors,

I need a little help with this, if anyone has the time and inclination:

>>> s = 'Hi "Python Tutors" please help'
>>> s.split()
['Hi', '"Python', 'Tutors"', 'please', 'help']
>>> 

I wish it would leave the stuff in quotes in tact:

['Hi', '"Python Tutors"', 'please', 'help']

Any suggestions?

Thank you.

Marilyn Davis




More information about the Tutor mailing list