python - Python 不一致问题 - Adafruit io
问题描述
所以我有一个简单的代码块:
# Import library and create instance of REST client.
from Adafruit_IO import Client, Feed
aio = Client('aio_bleepbloop')
# Get list of feeds.
feeds = aio.feeds()
# Print out the feed names:
for f in feeds:
print('Feed: {0}'.format(f.name))
dataRoll = aio.receive('diceRoll').value
dataType = aio.receive('diceType').value
print(dataRoll, dataType)
在一台运行 python 3.7.4 的 PC 上运行良好并运行 - 在我运行 3.8.5 的家用 PC 上,我收到此错误:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-10-41fb818ed5ba> in <module>
1 # Import library and create instance of REST client.
2 from Adafruit_IO import Client, Feed
----> 3 aio = Client('aio_bleepbloop')
4
5 # Get list of feeds.
TypeError: __init__() missing 1 required positional argument: 'key'
我真的不知道为什么。
解决方案
你可以试试
aio = Client("username", "aio_bloopbloop")
推荐阅读
- postgresql - 从表中删除用户
- java - 类作为字段的 Java 自定义注释(HAS-A 关系)
- python - 从另一列中获取具有至少一个指定值的值
- php - php中的异步Curl请求给出了错误的请求
- sql - 在会话表中计算用户登录的最快方法是什么?
- azure - Azure Policy - 拒绝缓存 Redis 的 IP 范围
- javascript - 自定义 URL 的渲染头部元素缺失 (React/NextJS)
- python - Pipwin 安装/PyInstaller 与不在路径中的 python
- python - 旧字典中的新词,具有特定值与适当键的组合
- nginx - ffmpeg HLS 中的 360 度视频支持