python 输入参数解包,模块导入,接收IO输入参数
2014-07-16 00:31
302 查看
#coding=utf-8 from sys import argv script,first,second,third = argv print "the script is=",script print "the first is=",first print "the second is=",second print "the third is=",third """ 执行方法 D:\>python heidpython02.py aa bb cc the script is= heidpython02.py the first is= aa the second is= bb the third is= cc """ """ 参数少于三个 D:\>python heidpython02.py aa bb Traceback (most recent call last): File "heidpython02.py", line 4, in <module> script,first,second,third = argv ValueError: need more than 3 values to unpack """ """ 超出三个参数 D:\>python heidpython02.py aa bb 66 88 Traceback (most recent call last): File "heidpython02.py", line 4, in <module> script,first,second,third = argv ValueError: too many values to unpack """ ##################### #接收用户输入 ##################### print "you name is ?" name=raw_input() print "how old are you?" age=raw_input() print "name:",name,"age:",age
相关文章推荐
- Python中的模块导入和读取键盘输入的方法
- python_基础总结1 python由来 字符编码 注释 pyc文件 python变量 导入模块 获取用户输入 流程控制if while
- Python基础:数据类型、变量定义、输入/输出、逻辑、函数/模块(导入)/类、异常处理
- Python中的模块导入和读取键盘输入的方法
- python接收输入参数和列表pop()方法的使用
- python 模块导入问题详解
- 如何拖动文件到python脚本中作为输入参数?
- python动态导入模块、检查模块是否安装
- Python模块学习 ---- StringIO, cStringIO 内存文件 收藏
- Python 的模块导入原理
- 详解Python模块导入方法
- python动态导入模块
- Python 的模块导入原理
- python 根据路径导入模块
- python 模块导入方法
- Python模块学习 -- StringIO, cStringIO 内存文件
- python3之模块导入和重载
- python 模块导入时的错误
- 对于直接地址栏输入的中文参数 在UTF-8系统中的接收,编码的问题.
- python模块导入__name__