python微信库有哪些_完美支持Py3的Python微信库

___ __ _______ ________ ___ ___ ________ _________ ________ ___ ___

|\ \ |\ \|\ ___ \ |\ ____\|\ \|\ \|\ __ \|\___ ___\\ __ \|\ \ / /|

\ \ \ \ \ \ \ __/|\ \ \___|\ \ \\\ \ \ \|\ \|___ \ \_\ \ \|\ \ \ \/ / /

\ \ \ __\ \ \ \ \_|/_\ \ \ \ \ __ \ \ __ \ \ \ \ \ \ ____\ \ / /

\ \ \|\__\_\ \ \ \_|\ \ \ \____\ \ \ \ \ \ \ \ \ \ \ \ \ \ \___|\/ / /

\ \____________\ \_______\ \_______\ \__\ \__\ \__\ \__\ \ \__\ \ \__\ __/ / /

\|____________|\|_______|\|_______|\|__|\|__|\|__|\|__| \|__| \|__||\___/ /

\|___|/

wechatpy.svg?branch=master

master?svg=true

coverage.svg?branch=master

quality-score.png?b=master

wechatpy.svg

git%2Bgithub.com%2Fjxtech%2Fwechatpy.svg?type=shield

微信(WeChat) 公众平台第三方 Python SDK。

Join%20Chat.svg

功能特性

普通公众平台被动响应和主动调用 API

企业号公众平台被动响应和主动调用 API

微信支付 API

安装

从 0.8.0 版本开始,wechatpy 消息加解密同时兼容 cryptography 和 PyCrypto,

优先使用 cryptography 库。因而不再强制依赖 PyCrypto 库。可先自行安装 cryptography 或者 PyCrypto 库:

# 安装 cryptography

pip install cryptography>=0.8.2

# 或者安装 PyCrypto

pip install pycrypto>=2.6.1

Tips: Windows 用户请先安装 PyCrypto 的二进制包后再使用 pip 安装 wechatpy 。 PyCrypto Windows 的二进制包可以在这里下载。

推荐使用 pip 进行安装:

pip install wechatpy

# with cryptography

pip install wechatpy[cryptography]

# with pycrypto

pip install wechatpy[pycrypto]

升级版本:

pip install -U wechatpy

使用示例

贡献代码

问题反馈

我们主要使用 GitHub issues 进行问题追踪和反馈。

QQ 群:176596300

qq-group.png

License

This work is released under the MIT license. A copy of the license is provided in the LICENSE file.

git%2Bgithub.com%2Fjxtech%2Fwechatpy.svg?type=large

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
使用Flask开发微信小程序后端的步骤如下: 1.安装Flask框架和微信开发工具包 ```shell pip install Flask pip install Flask-Wx ``` 2.创建Flask应用程序 ```python from flask import Flask, request from flask_wx import WxApp app = Flask(__name__) wxapp = WxApp(app) @app.route('/wechat', methods=['GET', 'POST']) def wechat(): if request.method == 'GET': return request.args.get('echostr', '') else: msg = wxapp.parse_message(request.data) return wxapp.response_text(msg, content='Hello, World!') ``` 3.配置微信公众号 在微信公众平台上配置服务器地址为`http://yourdomain.com/wechat`,并将Token设置为Flask应用程序中的Token。 4.运行Flask应用程序 ```shell export FLASK_APP=app.py flask run ``` 使用Tornado开发微信小程序后端的步骤如下: 1.安装Tornado框架和微信开发工具包 ```shell pip install tornado pip install tornado-wechat ``` 2.创建Tornado应用程序 ```python import tornado.ioloop import tornado.web from tornado_wechat import WeChatMixin, parse_message, response_text class WeChatHandler(tornado.web.RequestHandler, WeChatMixin): def prepare(self): self.parse_request_body() def get(self): self.write(self.get_argument('echostr')) def post(self): msg = parse_message(self.request.body) self.write(response_text(msg, content='Hello, World!')) app = tornado.web.Application([ (r'/wechat', WeChatHandler), ]) if __name__ == '__main__': app.listen(80) tornado.ioloop.IOLoop.current().start() ``` 3.配置微信公众号 在微信公众平台上配置服务器地址为`http://yourdomain.com/wechat`,并将Token设置为Tornado应用程序中的Token。 4.运行Tornado应用程序 ```shell python app.py ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值