我写了这个代码
但我总是得到这样一个错误:AttributeError:“Catalog”对象没有属性“component”。问题是我看不出问题出在哪里。有什么问题吗(可能是压痕?)。谢谢
下面是它发现错误的代码段
完整错误代码
Traceback (most recent call last)
File "C:/Users/lukasz.karasinski/Adobe CC 2020/Adobe CC 2020/Photoshop/main.py", line 186, in <module>
catalog.export_to_sql()
File "C:/Users/lukasz.karasinski/Adobe CC 2020/Adobe CC 2020/Photoshop/main.py", line 90, in export_to_sql
self.export_suites_to_sql(sql_file)
File "C:/Users/lukasz.karasinski/Adobe CC 2020/Adobe CC 2020/Photoshop/main.py", line 107, in export_suites_to_sql
suite_guid, suite.catalog_manufacturer_guid)
File "C:/Users/lukasz.karasinski/Adobe CC 2020/Adobe CC 2020/Photoshop/main.py", line 110, in export_components_to_sql
for key, component in self.component.items():
AttributeError: 'Catalog' object has no attribute 'component'
追溯显示了问题所在
for key, component in self.component.items():
在这一行中,self引用了
Catalog
类,正如错误告诉您的那样,它没有任何名为component
的属性。在init方法中定义一个名为components
的属性利克利,你打错了,应该改一下
for key, component in self.component.items():
到
for key, component in self.components.items():
相关问题 更多 >
编程相关推荐