Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
格式化时出现Python语法错误_Python - Fatal编程技术网

格式化时出现Python语法错误

格式化时出现Python语法错误,python,Python,产生: print "Detections before NMS = {}".format(detections) 输出: detections = 10 print ("Detections before NMS = {}".format(detections)) 如果您使用的是Python 3,print是一个函数,因此需要括号 我怀疑您使用的是Python 3,因此出现语法错误。1)不要添加“it's紧迫”。这里的人是志愿者,所以你的截止日期不相关。2) 我们无法从您提供的信息中判断

产生:

print "Detections before NMS = {}".format(detections)
输出:

detections = 10

print ("Detections before NMS = {}".format(detections))
如果您使用的是Python 3,
print
是一个函数,因此需要括号


我怀疑您使用的是Python 3,因此出现语法错误。

1)不要添加“it's紧迫”。这里的人是志愿者,所以你的截止日期不相关。2) 我们无法从您提供的信息中判断导致此错误的原因。您需要提供更多信息/显示更多代码,如果使用2.7,您可能希望开始使用
print(“text”)
而不是
print“text”
,因为后者在3.x中会失败
detections = 10

print ("Detections before NMS = {}".format(detections))
Detections before NMS = 10