I'm building up several command strings to pass to os.system. I want to group the common stuff into a string then add the specific stuff as needed. For example:
CMD = "python app.py %s -o %s > /dev/null"
option1 = "-i 192.169.0.1"
option2 = "results-file"
cmd = CMD, (option1, option2) #doesn't work
os.system(cmd)
I know cmd is a tuple. How do I get cmd to be the command string I want?
subprocess.callwith a list of arguments. docs.python.org/library/subprocess.html