On Aug 1, 12:41 am, Helmut Jarausch <[EMAIL PROTECTED]>
wrote:
> Many thanks to all of you!
> It's amazing how many elegant solutions there are in Python.

Here is yet another solution.

pexpect.split_command_line()

>From the documentation:
split_command_line(command_line)
    This splits a command line into a list of arguments.
    It splits arguments on spaces, but handles
    embedded quotes, doublequotes, and escaped characters.
    It's impossible to do this with a regular expression, so
    I wrote a little state machine to parse the command line.

http://pexpect.sourceforge.net/pexpect.html

But I am surprised to see there is a standard module already doing
this (shlex)

Karthik
>
> --
> Helmut Jarausch
>
> Lehrstuhl fuer Numerische Mathematik
> RWTH - Aachen University
> D 52056 Aachen, Germany


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to