how to write in stdout after to call a method (doing a system of notifications automatic (Iphone))

自古美人都是妖i 提交于 2019-12-20 04:16:11

问题


I'm trying to do a system of notifications automatic (Iphone) using https://github.com/simonwhitaker/PyAPNs. When you want to send a notification you call "apns.gateway_server.send_notification(key, payload)" and you have to enter the PEM pass phrase. Is there a way to enter this phrase through code?

Something like: call(apns.gateway_server.send_notification(key, payload), sys.stdout.write("my phars"))

I don't know how to do it


回答1:


import apns

gate = apns.APNs('keyfile','certfile').gateway_server()
gate.send_notification(key,payload)

Is there a problem when you run this?



来源:https://stackoverflow.com/questions/4657900/how-to-write-in-stdout-after-to-call-a-method-doing-a-system-of-notifications-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!