I am a C developer and I have decided to pick up python as well. I can't to figure out why I am unable to create an instance of a class I made inside of a separate module. Here is my car.py module that contains my Car object
class Car:
type = ""
def __init__(self, type):
self.type = type
And here is my other module that I am trying to use the Car object in
import car
x = Car()
print(x.type)
I get an error that says "Undefined variable 'Car' pylint(undefined-variable)" on the third line where I instantiate the car variable
I am also having trouble relocation the module to another directory within my project. The directory is named 'objects'. When I try to import the module, it says "No name 'car' in module 'objects' pylint(no-name-in-module)". Here is my import
from objects import car