tmcpy是淘宝开放平台消息服务的python版本。
安装推荐使用pip进行安装:
pip install tmcpy升级版本:
pip install -U tmcpy
用法示例
import loggingfrom tmcpy import TmcClientlogging.basicConfig(level=logging.DEBUG)tmc = TmcClient( 'ws://mc.api.tbsandbox.com/', 'appkey', 'appsecret', 'default', query_message_interval=50)def print1(): print 'on_open'tmc.on("open", print1)try: ioloop.IOLoop.instance().start()except KeyboardInterrupt: passfinally: tmc.close()
评论