Skip to content

Commit 124e65b

Browse files
author
Vincent
committed
更新简单使用事例
1 parent 7e46ed2 commit 124e65b

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

demo.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# coding=utf-8
2+
"""
3+
首先需要在微信公共平台申请帐号 mp.weixin.qq.com
4+
之后才可以使用下事例
5+
"""
16
__author__ = 'Vincent Ting'
27

3-
from weChat.client import Client
8+
from weChat.client import Client
9+
10+
client = Client(email='xx@gmail.com', password='yourPsw')
11+
12+
#demo 推送文字信息,其中sendto为关注该帐号的某用户的fakeId
13+
14+
client.sendTextMsg('xxxxxxx', 'Hello world')
15+
16+
#demo 推送图片信息,其中sendto为关注该帐号的某用户的fakeId,img为图片的文件路径
17+
18+
client.sendImgMsg('xxxxxxx', 'E:/demo.png')

0 commit comments

Comments
 (0)