python使用PyFetion来发送短信的例子
时间:2022-08-22 09:43:54
通过PyFetion可以很方便的使用python来用飞信发送短信,下面贴出代码:
from fetion import *
import os
def SendSMS(sms):
myphone = 'xxxxxx'
mypwd = 'oooooooooo'
tophone = 'oxoxoxoxoxox'
fetion = PyFetion(myphone,mypwd,'TCP')
fetion.login(FetionHidden)
print 'send to '+tophone
fetion.send_sms(sms,tophone,True)
print 'OK'
fetion.logout()
return True
msg = "hello world"
SendSMS(msg)
print 'OK!!!'
有时会提醒你输入验证码,验证码就在PyFetion生成的一个图片中,查看图片然后输入验证码就ok了.
PyFetion项目主页:https://code.google.com/p/pytool/
标签:python,PyFetion,短信
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
网页版权的正确写法
2007-09-22 09:13:00
Python中对字典的几个处理方法分享
2021-03-13 05:48:57
瀑布流布局代码一例
2023-08-25 07:33:19
pandas如何统计某一列或某一行的缺失值数目
2023-02-10 21:36:00
将tensorflow模型打包成PB文件及PB文件读取方式
2022-07-02 22:47:33
python静态方法实例
2023-02-17 12:03:22
django 连接数据库 sqlite的例子
2023-08-03 19:03:15
如何得到数据库中所有表名 表字段及字段中文描述
2012-01-05 18:56:44
关于基于字体大小(em)的设计
2008-06-17 15:01:00
Sql Server查询性能优化之不可小觑的书签查找介绍
2012-05-22 18:24:53
教你使用TensorFlow2识别验证码
2022-06-26 19:24:38
![](https://img.aspxhome.com/file/2023/3/92443_0s.jpg)
Python编程实现微信企业号文本消息推送功能示例
2022-09-30 19:45:19
详解python内置常用高阶函数(列出了5个常用的)
2023-01-11 18:52:19
python3+PyQt5使用数据库窗口视图
2023-03-08 10:44:26
![](https://img.aspxhome.com/file/2023/8/65858_0s.jpg)
通过表单的做为二进制文件上传request.totalbytes提取出上传的二级制数据
2011-03-16 10:39:00
使用python turtle画高达
2021-11-05 20:47:48
![](https://img.aspxhome.com/file/2023/2/84082_0s.jpg)
php实现网站留言板功能
2023-11-23 21:06:36
![](https://img.aspxhome.com/file/2023/1/111361_0s.jpg)
Python使用mmap实现内存映射文件操作
2022-04-26 14:37:19
![](https://img.aspxhome.com/file/2023/1/81611_0s.png)
Python最基本的输入输出详解
2023-11-27 16:49:24
使用JS+XML(数据岛)实现分页)
2005-08-18 00:46:06