- #打印命令行参数
- #!/usr/bin/python
- import sys
- import string
- if len(sys.argv) < 2:
- print "NO canshu"
- sys.exit(0)
- n = 1
- for i in sys.argv[1:]:
- strcanshu = str(i)
- print 'di',n,'ge canshu shi',strcanshu
- n = n + 1
- #该片段来自于http://www.codesnippet.cn/detail/2104201512351.html
来源: http://www.codesnippet.cn/detail/2104201512351.html