本文介绍了调用方法后如何在stdout中写入(自动执行通知系统(Iphone))的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 https://github.com/simonwhitaker创建自动通知系统(Iphone) /PyAPNs .当您要发送通知时,请调用"apns.gateway_server.send_notification(key,payload)",并且必须输入PEM密码.有没有办法通过代码输入这个短语?

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?

类似的东西:call(apns.gateway_server.send_notification(key,payload),sys.stdout.write("my phars"))

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

我不知道怎么做

推荐答案

import apns

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

运行此程序时有问题吗?

Is there a problem when you run this?

这篇关于调用方法后如何在stdout中写入(自动执行通知系统(Iphone))的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 03:41