Python ValueError:无法将字符串转换为浮点值:阈值
我对下面的命令有问题Python ValueError:无法将字符串转换为浮点值:阈值,python,threshold,Python,Threshold,我对下面的命令有问题 python signal_arduino_relax.py -t threshold Setting threshold to threshold 在执行此操作时,我遇到以下错误: Traceback (most recent call last): File "signal_arduino_relax.py", line 122, in <module> threshold = float(sys.argv[2]) ValueError: co
python signal_arduino_relax.py -t threshold
Setting threshold to threshold
在执行此操作时,我遇到以下错误:
Traceback (most recent call last):
File "signal_arduino_relax.py", line 122, in <module>
threshold = float(sys.argv[2])
ValueError: could not convert string to float: threshold
回溯(最近一次呼叫最后一次):
文件“signal_arduino_relax.py”,第122行,在
阈值=浮动(sys.argv[2])
ValueError:无法将字符串转换为浮点值:阈值
如何解决此问题?假设找到了正确的文档
threshold
是一个介于0和1之间的浮动,定义了移动汽车所需的放松程度
不要逐字复制命令。按照说明给出一个实际数字尝试将实际阈值作为
-t
的参数:-t1.0
将sys.argv[2]
设为实际数字如何?谢谢。让·弗朗索瓦和板球。