How can I use the subprocess module (i.e. call, check_call and Popen) to run more than one command?
For instance, lets say I wanted to execute the ls command twice in quick sucession, the following syntax does not work
import subprocess
subprocess.check_call(['ls', 'ls'])
returns:
CalledProcessError: Command '['ls', 'ls']' returned non-zero exit status 2.
for _ in range(2): subprocess.Popen('ls')not work for your solution?