runcommand#

class runcommand(command, printinput=False, printoutput=False, wait=True)[source]#

Make it easier to run shell commands.

Alias to subprocess.Popen().

Examples:

myfiles = sc.runcommand('ls').split('\n') # Get a list of files in the current folder
sc.runcommand('sshpass -f %s scp myfile.txt me@myserver:myfile.txt' % 'pa55w0rd', printinput=True, printoutput=True) # Copy a file remotely
sc.runcommand('sleep 600; mkdir foo', wait=False) # Waits 10 min, then creates the folder "foo", but the function returns immediately

Date: 2019sep04