Re: is there any lib can split string in this way?

2006-01-08 Thread Bengt Richter
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

Re: Is 'everything' a refrence or isn't it?

2006-01-08 Thread Donn Cave
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

Re: is there any lib can split string in this way?

2006-01-08 Thread Fredrik Lundh
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'] --

<    1   2