Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试为 Python 制作的 Wikimapia 使用pymapia API,但无法理解如何正确使用它。
import pymapia as PyMapia a = PyMapia.PyMapia.get_all_categories()
它给了我如下错误。
类型错误:必须使用 PyMapia 实例作为第一个参数调用未绑定的方法 get_all_categories()(什么都没有)
我不确定我是否在所有参数中都正确使用了它。我还为它生成了密钥。
pymapia.PyMapia是一类。您需要创建一个作为该类实例的对象,然后调用该对象的方法。
pymapia.PyMapia
尝试这个:
#UNTESTED import pymapia as PyMapia session = PyMapia.PyMapia("Your_Api_Key_Goes_Here") a = session.get_all_categories()