索夫
我在reddit上看到了一个关于在Pushbullet中使用Python的帖子,我想这会很方便,所以我尝试使用Python通过PushBullet发送通知,但是我遇到了几个问题
1)找不到每个ID对应的设备...
2)由于AttributeError: 'NoneType' object has no attribute 'push_note'
错误,我无法向任何设备推送任何内容
PushBullet.py = https://pypi.python.org/pypi/pushbullet.py/0.4.1
Github项目:https://github.com/randomchars/pushbullet.py
运行以下代码:
from pushbullet import PushBullet
pb = PushBullet("ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890")
print pb.devices
phone = pb.get("1234567890")
print phone
push = phone.push_note("This is the title", "This is the body")
print(push.status_code)
返回:
[Device('ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890', 1234567890), Device('ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890', 0000000000), Device('ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890', 1111111111), Device('ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890', 2222222222)]
None
Traceback (most recent call last):
File "C:\Users\Admin\Desktop\PushBullet_Test.py", line 9, in <module>
push = phone.push_note("This is the title", "This is the body")
AttributeError: 'NoneType' object has no attribute 'push_note'
请注意,他们的文档在push_note示例中有一个语法错误,它不应该在结束括号之前有一个句号/句号。
我在任何地方都找不到任何解决这个问题的方法,甚至找不到有这个问题的人:
https://stackoverflow.com/questions/23845936
复制相似问题