学习python使用rabbitmq,遇到麻烦
巴扎黑
巴扎黑 2017-04-17 13:51:29
0
2
443
巴扎黑
巴扎黑

reply all(2)
刘奇

if not isinstance(host, basestring):

NameError: global name 'basestring' is not defined

Indicates that basestring does not exist, you need to import it or define this variable
Such as a="test"
if not isinstance(a, str): #str is the type of type, so there is no need to import it. If not, you need to import this class or method
print "Not a string type"
else:
print "This is a string type"

Ty80

There is no basestring type in python3, you can convert it. Please refer to this http://woodpecker.org.cn/peintopython3/porting-code-to-python-3-with-2to3.html

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template