Python 模块对象不可调用
出于某种原因,我得到了一个模块对象是不可调用的错误。我真的不明白为什么?发生了什么事?我该怎么解决( 追溯:Python 模块对象不可调用,python,object,module,Python,Object,Module,出于某种原因,我得到了一个模块对象是不可调用的错误。我真的不明白为什么?发生了什么事?我该怎么解决( 追溯: Traceback (most recent call last): File "time.py", line 1, in <module> import time File "/Users/Me/randomcode/time.py", line 2, in <module> start_time = time.time() TypeEr
Traceback (most recent call last):
File "time.py", line 1, in <module>
import time File "/Users/Me/randomcode/time.py", line 2, in <module>
start_time = time.time()
TypeError: 'module' object is not callable
回溯(最近一次呼叫最后一次):
文件“time.py”,第1行,在
导入时间文件“/Users/Me/randomcode/time.py”,第2行,在
开始时间=time.time()
TypeError:“模块”对象不可调用
不要调用自己的脚本文件time.py
…它正在导入自身!代码是正确的。请提供Expection的堆栈跟踪。回溯(最近一次调用):文件“time.py”,第1行,在导入时间文件“/Users/Thambapillai/randomcode/time.py”,第2行,在start\u time=time.time()TypeError:“模块”对象不可用callable@Ravin:将stacktrace编辑到您的问题中。实际上,请将其删除-我刚刚删除了另一个文件,它成功了!谢谢!!:D@Ravin这个✓ 图标是你的朋友!
Traceback (most recent call last):
File "time.py", line 1, in <module>
import time File "/Users/Me/randomcode/time.py", line 2, in <module>
start_time = time.time()
TypeError: 'module' object is not callable