Created
February 21, 2012 00:52
-
-
Save hidsh/1872635 to your computer and use it in GitHub Desktop.
python args test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys # args | |
for a in enumerate(sys.argv): | |
print ' sys.argv[%d]: \'%s\'' % a | |
# result | |
# D:\py>args_basic.py aa bb cc | |
# sys.argv[0]: 'D:\py\args_basic.py' | |
# sys.argv[1]: 'aa' | |
# sys.argv[2]: 'bb' | |
# sys.argv[3]: 'cc' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment