#encode:utf-8
import APNSWrapper
import binascii
deviceToken = binascii.unhexlify('2cd40912550d672f9489056c200a23e4bd298ef665807760c51d66bfce9f2d7d')
# create wrapper
wrapper = APNSWrapper.APNSNotificationWrapper('ck.pem', True)
# create message
message = APNSWrapper.APNSNotification()
message.token(deviceToken)
message.badge(5)
message.alert("hellowrold 234234")
# add message to tuple and send it to APNS server
wrapper.append(message)
wrapper.notify()
使用的是http://code.google.com/p/apns-python-wrapper