【发布时间】:2018-06-17 23:58:59
【问题描述】:
这是给我带来麻烦的代码:
import time
from time import time
time.sleep(1)
start=time()
input=raw_input(' ')
end=time()
time.sleep(1)
print (start - end)
问题是以下两个与time 同名的导入:
import time
from time import time
如何在我的代码中访问这两个模块?我需要在我的代码中同时使用以下两行:
lines time()
and time.sleep()
但是一旦导入,第二个模块会覆盖第一个。
【问题讨论】:
标签: python python-3.x time import