Jun-22-2019, 11:46 PM
This error:
I dont see anywhere in your code where
Either you are not importing it right or your class is lowercase.
In the module product.py change the class to
Error:Traceback (most recent call last):
File "test11.py", line 71, in <module>
Product.create_products()
NameError: name 'Product' is not defined
is referring to the fact that on this line:Product.create_products()Product is undefined.
I dont see anywhere in your code where
Product
is defined. I only see product
. They are two different things.Either you are not importing it right or your class is lowercase.
In the module product.py change the class to
class Product(object):instead of
class product(object):
Recommended Tutorials: