Home >Backend Development >Python Tutorial >python调用短信猫控件实现发短信功能实例

python调用短信猫控件实现发短信功能实例

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-16 08:43:291830browse

python调用短信猫控件实现发短信功能实例代码如下所示:

#! /usr/bin/env python
#coding=gbk
import sys
import win32com.client
ocxname='ShouYan_SmsGate61.Smsgate'
axocx=win32com.client.Dispatch(ocxname)
axocx.CommPort=8#设置COM端口号
axocx.SmsService='+8613800100500'#设置短信服务号码
axocx.Settings='9600,n,8,1'#设置com端口速度
axocx.sn='loyin'
c=axocx.Connect(1)#连接短信猫或手机
print '连接情况',axocx.Link()
axocx.SendSms('python确实是很好的','15101021000',0)#发送短信
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn