我只想使用导入时间函数从python获取时间戳.
import time
Run Code Online (Sandbox Code Playgroud)
我有这个示例测试代码,它在云9上运行得很好.
import time
now = int(time.time() * 1000)
print now
Run Code Online (Sandbox Code Playgroud)
但它在我的Mac上不起作用.我在第1行得到了一个错误.
Python 2.7.11 (default, Mar 21 2016, 23:21:56)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "time.py", line 2, in <module>
now = int(time.time() * 1000)
TypeError: 'module' object is not callable
>>>
Run Code Online (Sandbox Code Playgroud)
不确定这里发生了什么令人沮丧.
| 归档时间: |
|
| 查看次数: |
3692 次 |
| 最近记录: |