新人想学自动化,刚学习简单的python遇到了问题
from sys import argvscript, 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)
运行后C:\Users\Administrator\AppData\Local\Programs\Python\Python36\python.exe D:/python/笨方法学python/case13.py
Traceback (most recent call last):
File "D:/python/笨方法学python/case13.py", line 3, in <module>
script, first, second, third = argv
ValueError: not enough values to unpack (expected 4, got 1)
上网百度过 说要在命令行 运行pythoncase13.py arg 1 arg2 arg 3
但是返回报错找不到文件 你安装的是python2,还是3?
把script, first, second, third = argv
改成script, first, second, third = argv,argv,argv,argv 试一下呢 海海豚 发表于 2018-2-27 13:28
你安装的是python2,还是3?
把script, first, second, third = argv
改成script, first, second, third = ...
python 3 可以参考下下面的地址哦~~~
https://www.zhihu.com/question/50655848/answer/122024168
页:
[1]