I need to run this on the command line:
Code:
./prog -command 'trace("foo")'
... but it needs to be run by python, so I'm trying assemble the args & run like so:
Code:
args = ['prog','-command \'trace("foo")\'']
os.execvp("prog",args)
but I keep getting errors that seem to be related to the escaping of quotes and such. For example:
Code:
['prog', '-command \\\'trace("hello")\\\'']
Unmatched '.
---- or ----
['prog', '-command \'trace(\\"hello\\")\'']
Badly placed ()'s.
Not quite sure how to do this.
If I run from the command line, this works:
./prog -command 'trace("foo")'
so how can I get that to happen from within python?