打印命令行参数

2015-11-06 0 985
打印命令行参数
#打印命令行参数
#!/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

遇见资源网 python 打印命令行参数 http://www.ox520.com/15901.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务