python使用PyFetion来发送短信的例子

yipeiwu_com7年前Python基础

通过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/

相关文章

pytorch中获取模型input/output shape实例

Pytorch官方目前无法像tensorflow, caffe那样直接给出shape信息,详见 https://github.com/pytorch/pytorch/pull/3043...

Python socket模块方法实现详解

这篇文章主要介绍了Python socket模块方法实现详解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下 socket ssh (不...

详解python3中socket套接字的编码问题解决

一、TCP 1、tcp服务器创建 #创建服务器 from socket import * from time import ctime #导入ctime HOST = ''...

python之cv2与图像的载入、显示和保存实例

python之cv2与图像的载入、显示和保存实例

本文是OpenCV 2 Computer Vision Application Programming Cookbook读书笔记的第一篇。在笔记中将以Python语言改写每章的代码。 P...

使用python实现滑动验证码功能

使用python实现滑动验证码功能

首先安装一个需要用到的模块 pip install social-auth-app-django 安装完后在终端输入pip list会看到 social-auth-app-djang...