Reputation: 8277
I want to expand tuple items i have collected from sys.argv to be passed as argument
like below
os.system('git send-email ' + *args)
but its giving error at *args
Upvotes: 1
Views: 591
Reputation: 369054
How about using subprocess.call
:
subprocess.call(['git', 'send-email'] + list(args))
See Replacing Older Functions with the subprocess
Module.
Upvotes: 5
Reputation: 25813
How about this:
import subprocess
cmd = ['git', 'send-email']
cmd.extend(args)
subprocess.call(cmd)
Upvotes: 1
Reputation: 561
would it be a simple as?
os.system('git send-email ' + ' '.join(args))
Upvotes: 2