python 脚本接收参数

Posted on Posted in python

**code**

  1. #!/usr/bin/env python  
  2. # -*- coding:utf-8 -*-  
  3.   
  4. import sys  
  5.   
  6. print 'script name: ', sys.argv[0]  
  7.   
  8. for i in range(1, len(sys.argv)):  
  9.     print 'vars : ', i , sys.argv[i]  
» 转载请注明来源:若我若鱼 » python 脚本接收参数

Leave a Reply

Your email address will not be published. Required fields are marked *

3 × 5 =