Python - AttributeError: ‘NoneType‘ object has no attribute ‘name‘

Python - AttributeError: ‘NoneType’ object has no attribute ‘name’


1、起因

对象没有这个数据,而却要访问这个属性,导致报错

2、举例

if __name__ == '__main__':
    f = None
    print

猜你喜欢

转载自blog.csdn.net/qq_15071263/article/details/107818351