On 04/16/2013 08:14 AM, PEnergy wrote: > Greetings, > > I am trying to write a python script that, when called from the DOS > prompt, will call another python script and pass it input variables. > My current code will open the other python script but doesn't seem to > pass it any values: > > import os,sys,subprocess > subprocess.Popen(['python.exe','C:\NDEX\GRE2\uip\uip_20.py','t3c*'])
I find it easier just to write my python programs such that they can be imported into other python scripts. Usually I use this form: def func(*whatever): pass if __name__ == "__main__": # parse command-line arguments # call functions in this module with those args func(1,2,3,etc) This way a script can be run standalone, or I can import it and access its attributes direction. I recommend you consider this approach. -- http://mail.python.org/mailman/listinfo/python-list