Just started Python again and now I'm already stuck on the following...
I'm trying to use subprocess.Popen with a variable with a whitespace in it (a Windows path).
Doing a print on the variable the variable seems to work fine. But when using the variable in subprocess.Popen, the variable is cut off by the first whitespace.
Below a part of the script (the variable 'image_file' contains the Windows Path(s) with spaces)
def start_phone(image_file): cmd = tar_exe + " -tf "+ image_file print (cmd) subprocess.Popen(cmd, shell=True) How can I use subprocess with a variable with whitespaces (path) in it?