I am trying to execute a python script using the subprocess module. I am
feeding parameters into the script, which reads them using argparse and returns
a list.
The script simply returns a list when called. When I execute my script from my
prompt, I get the following:
H:\pythonscripts>installModule.pyc --mods mod1 mod2 mod3
['mod1', 'mod2', 'mod3']
# This is the result I would like
When I call the script from within another script using subprocess I get an
error:
p = subprocess.Popen(r'installModule.py --mods mod1 mod2 mod3',
executable = sys.executable, stdout = subprocess.PIPE, stderr =
subprocess.STDOUT)
'Unknown option: --\r\n'
'usage: installModule.py [option] ... [-c cmd | -m mod | file | -] [arg]
...\r\n'
Is the subprocess module the best thing for me to use? Is there a better way
to call this script?
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor