By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,898 Members | 1,325 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,898 IT Pros & Developers. It's quick & easy.

python newb question : how to pass arguments to a function using DOS cmd line

P: 1
Hi ,
how can we pass arguments to a function located in xyz.py file using the DOS command Prompt.

I know its very easy to pass using the python command line but m finding it impossible to do this same thing on the DOS prompt.


[In Python command line, i used sys.argv[..] to pass the args ..BUT how should we pass arguments using DOS prompt]


-Megh
The trouble with being punctual is that nobody's there to appreciate it.
May 24 '07 #1
Share this Question
Share on Google+
1 Reply


bvdet
Expert Mod 2.5K+
P: 2,851
Hi ,
how can we pass arguments to a function located in xyz.py file using the DOS command Prompt.

I know its very easy to pass using the python command line but m finding it impossible to do this same thing on the DOS prompt.


[In Python command line, i used sys.argv[..] to pass the args ..BUT how should we pass arguments using DOS prompt]


-Megh
The trouble with being punctual is that nobody's there to appreciate it.
sys.argv[i] is also used at the command prompt. Sample:
Expand|Select|Wrap|Line Numbers
  1. C:\python script.py arg1 arg2 arg3
May 24 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.