【问题标题】:python stripe is not returning expected resultpython条没有返回预期结果
【发布时间】:2021-01-27 11:44:42
【问题描述】:

在我的 python 代码中,我有一个使用此代码获取 3 条客户列表的代码:

import stripe
stripe.api_key = "sk_test_DftufeqrQlvZHqPdIgGmf9ro00exkHljNF"
stripe.Customer.list(limit=3)
print(stripe)

我得到的输出是:

<module 'stripe' from '/var/www/html/project/myenv/lib/python3.6/site-packages/stripe/__init__.py'>

我不知道为什么我得到这个而不是结果,谁能帮我解决这个问题??

【问题讨论】:

  • 不应该像result = stripe.Customer.list(limit=3)然后打印(结果)吗?

标签: python-3.x django stripe-payments python-3.6


【解决方案1】:

如果将列表分配给变量,则可以打印它们。 stripe 是 Python 客户端库对象。

customers = stripe.Customer.list(limit=3)
print(customers)

或者没有变量:

print(stripe.Customer.list(limit=3))

【讨论】:

    猜你喜欢
    • 2016-06-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-16
    • 1970-01-01
    • 1970-01-01
    • 2019-10-13
    • 1970-01-01
    相关资源
    最近更新 更多