【发布时间】:2014-05-20 21:01:38
【问题描述】:
我正在运行 pytzwhere 包提供的最简单的测试问题。模块导入,但出现错误。 pytzwhere 似乎是从 GPS 坐标获取时区的一个不错的离线选项,但没有太多文档。任何有关如何协调这一点的帮助表示赞赏!
In [94]:
import tzwhere
w = tzwhere()
print w.tzNameAt(1.352083, 103.819836)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-94-0b50c8083e93> in <module>()
1 import tzwhere
2
----> 3 w = tzwhere()
4 print w.tzNameAt(1.352083, 103.819836)
TypeError: 'module' object is not callable
编辑:
已通过以下 cmets 的以下代码修改解决了此问题 -
In [108]:
from tzwhere import tzwhere
w = tzwhere.tzwhere()
print w.tzNameAt(1.352083, 103.819836)
-----------------------------------------------------------------------------
Reading json input file: /Users/user/anaconda/lib/python2.7/site-packages/tzwhere/tz_world_compact.json
Asia/Singapore
【问题讨论】: