下载mns
wget http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/assets/attach/32305/cn_zh/1490269182462/aliyun-mns-python-sdk-1.1.4.zip
解压
unzip aliyun-mns-python-sdk-1.1.4.zip
安装
cd mns_python_sdk
su - root
python setup.py install
运行
from mns.account import Account
from mns.topic import DirectSMSInfo, TopicMessage
from mns.mns_exception import MNSExceptionBase
'''
Step 1. 获取主题引用
'''
# 从https://account.console.aliyun.com/#/secure获取$YourAccountid
# 从https://ak-console.aliyun.com/#/accesskey获取$YourAccessId和$YourAccessKey