Subprocess Call In Python
Solution 1:
call(["SetFile", "-c ",'""',"-t ",'""',"argument"])
Python treats both '
& "
as valid string delimiters, thus this is possible. Even otherwise you can escape the quotes. In fact you've used string with '
delimits with '__main__'
in your code.
After looking at the errors you're getting I would try the belowcall(["SetFile", "argument"])
Solution 2:
According to the documentation, you can pass empty strings:
args is required for all calls and should be a string, or a sequence of program arguments. Providing a sequence of arguments is generally preferred, as it allows the module to take care of any required escaping and quoting of arguments (e.g. to permit spaces in file names). If passing a single string, either shell must be True (see below) or else the string must simply name the program to be executed without specifying any arguments.
You can also pass quotes: "''"
Post a Comment for "Subprocess Call In Python"