Home > Software design >  object is not callable but I do not know how to divide the module into each other
object is not callable but I do not know how to divide the module into each other

Time:12-27

 import mains
 print(mains.hi())
 import parsogv2
 print(parsogv2.gets())

 priliv = mains()/parsogv2()

I have this trouble 'module' object is not callable. I want to split the values I get in modules How to do it better ? Combine them into one module or can I do as I wanted in the code ?

CodePudding user response:

If what you've been trying to do is divide the return values of mains.hi() and parsogv2.gets(), then what you should be doing is:

priliv = mains.hi()/parsogv2.gets()

The error you've been receiving, informing you that a module is not callable, is a result of your attempt to call the actual modules (mains and parsogv2) instead of the functions they contain (mains.hi and parsogv2.gets), which I assume is what you were going for.

  • Related