Python calls the SMS cat control to implement the SMS function instance

  • 2020-04-02 13:48:14
  • OfStack

Python calls the SMS cat control to achieve the SMS function example code as follows:


#! /usr/bin/env python
#coding=gbk
import sys
import win32com.client
ocxname='ShouYan_SmsGate61.Smsgate'
axocx=win32com.client.Dispatch(ocxname)
axocx.CommPort=8# Set up the COM The port number 
axocx.SmsService='+8613800100500'# Set the SMS service number 
axocx.Settings='9600,n,8,1'# Set up the com Port speed 
axocx.sn='loyin'
c=axocx.Connect(1)# Connect to SMS cat or mobile phone 
print ' connectivity ',axocx.Link()
axocx.SendSms('python It's really good ','15101021000',0)# Send a text message 

Related articles: