Podio:Python-API 的示例代码导入了一个我在任何地方都找不到的模块

Podio: The sample code for the Python-API imports a module that I can't find anywhere

这是验证的示例代码:

from pypodio2 import api
from client_settings import * #doesn't exist

c = api.OAuthClient(
    client_id,
    client_secret,
    username,
    password,    
)
print c.Items.get_item(22342)

它给我的错误是找不到 client_settings-module,我也找不到它,无论是在我的计算机上还是在网上。由于代码似乎是 Python 2,我怀疑 client_settings 可能是 Python 2 遗物?如果没有,我在哪里可以找到它?

似乎client_settings只是为了方便而创建的一个简单的自定义模块。它包含 client_id、client_secret、用户名、密码及其值的定义。这些是特定于程序的,因此这不是库模块或其他东西,而只是一个包含它们定义的 python 文件。您可以创建一个(只需打开一个新的 python 文件又名模块):

#This is in module client_settings.py
client_id = "blahbleeblue"
client_secret = "thisIsSuperSecret"
username = "dora"
password = "theexplorer"

那么您提供的示例代码应该可以工作(当然假设我们定义的所有变量都符合它们需要的格式)