Use a list instead:
task = ["svn", "move", "folder/hello world", "anotherfolder/hello world"]
subprocess.check_call(task)
If your file contains whole commands, not just paths then you could try shlex.split():
task = shlex.split(s)
subprocess.check_call(task)
More Related Contents:
- Actual meaning of ‘shell=True’ in subprocess
- How to terminate a python subprocess launched with shell=True
- Python subprocess readlines() hangs
- Getting a list of all subdirectories in the current directory
- How to redirect output with subprocess in Python?
- Python subprocess get children’s output to file and terminal?
- Subprocess changing directory
- Calculating a directory’s size using Python?
- How to import a Python class that is in a directory above?
- Blocking and Non Blocking subprocess calls
- Launch a completely independent process
- How do I pipe a subprocess call to a text file?
- Multiple inputs and outputs in python subprocess communicate
- Python C program subprocess hangs at “for line in iter”
- Popen with conflicting executable/path
- How do I check if directory exists in Python?
- How to write to stdout AND to log file simultaneously with Popen?
- link several Popen commands with pipes
- Python running as Windows Service: OSError: [WinError 6] The handle is invalid
- Display realtime output of a subprocess in a tkinter widget
- Kill a running subprocess call
- Can you make a python subprocess output stdout and stderr as usual, but also capture the output as a string? [duplicate]
- Python subprocess: how to use pipes thrice? [duplicate]
- Subprocess timeout failure
- What’s the difference between subprocess Popen and call (how can I use them)?
- Given a path, how can I extract just the containing folder name?
- How to get the output from os.system()? [duplicate]
- Deleting folders in python recursively
- subprocess.Popen in different console
- printing stdout in realtime from a subprocess that requires stdin