Heiko Wundram <[EMAIL PROTECTED]> wrote:

> Don't get me wrong, I personally find this functionality very, very
> interesting (I'm +0.5 on adding it in some way or another),
> especially as a
> part of the standard library (not necessarily as an extension to
> .split()).


It's already there. It's called shlex.split(), and follows the semantic of a
standard UNIX shell, including escaping and other things.

>>> import shlex
>>> shlex.split(r"""Hey I\'m a "bad guy" for you""")
['Hey', "I'm", 'a', 'bad guy', 'for', 'you']

Giovanni Bajo

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to