There is a Connector class that has the following constructor:
class Connector(): def __init__(self, filename='config.ini', section='mysql'): parser = ConfigParser() parser.read(filename) self.db = {} if parser.has_section(section): items = parser.items(section) for item in items: self.db[item[0]] = item[1] else: raise Exception('{0} not found in the {1}'.format(section, filename)) If i do
if __name__ == '__main__': connector = Connector() in the same module where it lies, then everything works. However, when creating an object in another module, an error occurs:
TypeError: 'module' object is not callable What's the matter ?
from Connector import Connector- user194374