Hi all,
I am using pexpect to drive another tool. Some of the data I get back
would be better suited as a list and I want to know a simple way to
parse the data to push it into a list.
For example
I get the following string back. I want to convert this to a list:
'("." ".." "cdslib_cleanup.py" "cadence.py"
"cdsinit_cdsenv_cleanup.py")'
should be:
["." ".." "cdslib_cleanup.py" "cadence.py"
"cdsinit_cdsenv_cleanup.py"]
It should be able to handle embeded lists like this:
'("." ("cadence.py" "foo_cleanup.py") "cdslib_cleanup.py" "cadence.py"
"cdsinit_cdsenv_cleanup.py")'
should become
["." ["cadence.py" "foo_cleanup.py"] "cdslib_cleanup.py" "cadence.py"
"cdsinit_cdsenv_cleanup.py"]
Is there some exisitng code which will handle this task?
--
http://mail.python.org/mailman/listinfo/python-list