Home > Back-end >  why my code is generating the error module object is not callable while calling tictoc() function
why my code is generating the error module object is not callable while calling tictoc() function

Time:09-03

I am using Python3.10 IDLE

Exception in Tkinter callback

dcoument_sensitive_analysis1.py", line 182, in processMessage

t2 = tictoc('name')

TypeError: 'module' object is not callable

CodePudding user response:

you can run print(tictoc.__file__) to see where it came. Some modules are virtual, but most will have a file associated with it.

If this was unexpected, then perhaps you assigned the value somewhere. for example

import json
tiktoc = json
print(tiktoc.__file__)

outputs '/usr/lib64/python3.10/json/__init__.py' for me.

CodePudding user response:

If tictoc is a module that you imported, then you cannot call it. You probably are looking for a function named tictoc inside the module tictoc. Maybe this will help.

from tictoc import tictoc

t2 = tictoc('name')

Albeit, you cannot expect us to give a clear solution if you don't show us all of the source.

  • Related