+ -
当前位置:首页 → 问答吧 → python3.1 XP下的IDLE环境,怎么输入系统sys.argv参数?

python3.1 XP下的IDLE环境,怎么输入系统sys.argv参数?

时间:2010-12-14

来源:互联网

Python code
#!/usr/bin/python
# Filename: using_sys.py
import sys
print ('The command line arguments are:')
for i in sys.argv:
    print (i)
print ('\n\nThe PYTHONPATH is', sys.path, '\n')


书上例子的程序运行结果:
$ python using_sys.py we are arguments
The command line arguments are:
using_sys.py
we
are
arguments

但是,我的总是:
The command line arguments are:
E:\2,Python\using_sys.py

不知道怎么输入 "we are arguments"参数,请大侠们指导下

作者: taiyangniao   发布时间: 2010-12-14

把sys.argv打出来看下。

作者: iambic   发布时间: 2010-12-14

在命令行运行:
python using_sys.py we are arguments

作者: feilniu   发布时间: 2010-12-14

该回复于2010-12-14 14:38:32被管理员删除

  • 对我有用[0]
  • 丢个板砖[0]
  • 引用
  • 举报
  • 管理
  • TOP
#4楼 得分:0回复于:2010-12-14 13:41:27
官版提供idle貌似不行吧,如2楼说的在cmd下,非用idle嘛打patch试试...

http://bugs.python.org/issue5680

作者: iambic   发布时间: 2010-12-14