I was creating my module and when I tested it, I got an error.
The code was like this:
class test:
def __init__(self,size,type):
self.type = type
self.size = size
And after I import the module, when I type:
x=test(10,'A type')
It says:
TypeError: 'module' object is not callable
Please help me.
You didn’t paste your import, but I’m betting you used
where your file is called
test.py(which should probably be more descriptive, BTW) which imports the module, which is why it’s objecting that test is a module object and isn’t callable. You can access your class by callingor alternatively you could use
after which
should work.