On Mon, 9 Jan 2006 13:59:44 +0800, Leo Jay <[EMAIL PROTECTED]> 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?
>
Narrowly interpreting your requirements (only quotes are with
double quote
Quoth [EMAIL PROTECTED]:
| Fredrik Lundh wrote:
| ...snip...
| > afaik, the Python Language Reference never defines the word "reference".
| > It carefully defines words like "object" and "value", though, and terms like
| > "call by object" or "call by object reference" are perfectly understandable
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?
>>> s = 'abc def "this is a test" ok'
>>> import shlex
>>> shlex.split(s)
['abc', 'def', 'this is a test', 'ok']
--
101 - 103 of 103 matches
Mail list logo