Nov-28-2019, 03:32 PM
(This post was last modified: Nov-28-2019, 03:32 PM by Gribouillis.)
r'
is not some magical operator that would apply to abitrary expressions. Instead, r'...'
is a special kind of literal string where the \ character is taken literaly instead of being used as an escape character. Thus you can writethe_command = r"a dot exe file with 3 options" subprocess.call (the_command, shell = True)Most of the time however, shell=True is superfluous and/or detrimental and it is better to split the command in a list of arguments
import shlex the_command = shlex.split(r"a dot exe file with 3 options") subprocess.call (the_command)