shlex parsing

Nobody nobody at nowhere.com
Thu Jul 28 12:37:36 EDT 2011


On Thu, 28 Jul 2011 17:48:34 +0200, Web Dreamer wrote:

>> I would like to parse this TCL command line with shlex:
>> 
>> '-option1 [get_rule A1 B2] -option2 $VAR -option3 TAG'

>>>> s = s.replace('[','"[')
>>>> s = s.replace(']',']"')

Note that this approach won't work if you have nested brackets or braces.
That would require a real parser.




More information about the Python-list mailing list