Oliver -
Here is a simpler approach, hopefully more readable, using pyparsing
(at http://pyparsing.sourceforge.net). I also added another test word
to your sample input line, one consisting of a lone pair of double
quotes, signifying an empty string. (Be sure to remove leading '.'s
from Python t
oliver wrote:
i'm experimanting with imaplib and came across stringts like
(\HasNoChildren) "." "INBOX.Sent Items"
in which the quotes are part of the string.
now i try to convert this into a list. assume the string is in the variable
f, then i tried
f.split()
but i end up with
['(\\Ha
oliver wrote:
hi there
i'm experimanting with imaplib and came across stringts like
(\HasNoChildren) "." "INBOX.Sent Items"
in which the quotes are part of the string.
now i try to convert this into a list. assume the string is in the variable
f, then i tried
f.split()
but i end up with
> is there another way to convert a string with quoted sub entries into a
> list of strings?
try the csv-module.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
oliver wrote:
i'm experimanting with imaplib and came across stringts like
(\HasNoChildren) "." "INBOX.Sent Items"
in which the quotes are part of the string.
now i try to convert this into a list. assume the string is in the variable
f, then i tried
f.split()
but i end up with
['(\\Ha
hi there
i'm experimanting with imaplib and came across stringts like
(\HasNoChildren) "." "INBOX.Sent Items"
in which the quotes are part of the string.
now i try to convert this into a list. assume the string is in the variable
f, then i tried
f.split()
but i end up with
['(\\HasNo