This has been asked not long ago. the shlex module as well as csv module both should be able to handle it. for this simple case shlex.split() seems to be the easiest.
Leo Jay wrote: > I want to split a string like this: > 'abc def "this is a test" ok' > into: > ['abc', 'def', 'this is a test', 'ok'] > > is there any lib meet my need? > > thanks > > -- > Best Regards, > Leo Jay -- http://mail.python.org/mailman/listinfo/python-list