Python:关于argv
2014-10-29 13:41
106 查看
代码test.py
执行
说明:参数是在用户执行命令时就要输入,就要用到argv
# -*- coding: utf-8 -*- from sys import argv script,first,second,third =argv print "The script is called:" ,script print "Your first variable is :", first print "Your second variable is :", second print "Your third variable is :", third print script
执行
D:\Python_Code>python test.py <strong><span style="color:#ff0000;">1 2 3 </span></strong> The script is called: test.py Your first variable is : <span style="color:#ff0000;">1 </span>Your second variable is :<span style="color:#ff0000;"> 2</span> Your third variable is : <span style="color:#ff0000;">3 </span>test.py
说明:参数是在用户执行命令时就要输入,就要用到argv
相关文章推荐
- python中关于__file__ 和 sys.argv[0]的使用
- 关于Python的Debug...
- Ibm 论坛上一篇关于Python读物的推荐和书评
- 在论坛中找到的几个关于Python的小问题的解决方法
- 关于main函数的argv和envp参数
- [转]Python中关于文件路径的简单操作
- 关于python下网络编程
- Python中关于属性回调的实现
- python写的模块:财务管理中关于时间价值的函数
- 一个关于Python的类覆盖的问题
- 关于Python的一些资源
- 关于Python的线程
- 为了学好python,准备做个关于python的站点
- 发现Python的源代码中关于字符串fastsearch算法的一个笔误!
- 关于用python的SQLAlchemy访问数据库的学习记录,及SQLAlchemy的安装简介
- 应该写点关于python的东西才是
- 关于在组件GIS开发中使用Python的一点补充说明
- 关于Python的super用法研究
- 【听译大师说话】python 创始人访谈录 1: 关于 django 和 ruby
- Leo推荐的关于python的好地方