关于AttributeError: type object ‘XXX‘ has no attribute ‘XXX‘的问题
生活随笔
收集整理的這篇文章主要介紹了
关于AttributeError: type object ‘XXX‘ has no attribute ‘XXX‘的问题
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
關于AttributeError: type object ‘XXXXXX’ has no attribute 'name’的報錯的原因,先運行運行一段代碼
例如:
運行結果為:
print(Person.name) AttributeError: type object 'Person' has no attribute 'name'錯誤原因:因為類調用了實例屬性,
類是不能調用實例屬性的
總結
以上是生活随笔為你收集整理的关于AttributeError: type object ‘XXX‘ has no attribute ‘XXX‘的问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python网络编程—TCP协议(二)
- 下一篇: python网络编程—UDP协议