Possible duplicate:
What happens to shlex.split handling?
How to convert a list of command line options like argv to a single line for the command line?
" ".join(argv) not the right solution, since it will not correctly delete lines with spaces.
Example: ./test.py -v --simulate --action removePage --title "AAA BBB"
If you try this, the last argument is AAA BBB without quotes, but if I try to rebuild the command line using a connection, I will get the wrong result.
Note. I know that I can get the command line as a string, but in my case I cannot rely on this, I need a solution that converts the argument list to the correct command line.
sorin source share