forked from Goodhao926/face_recognition
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
25 lines (22 loc) · 834 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
def char(data):
wx = wx_deal()
# 表情处理
if (data.find('表情') != -1):
if (data.find('文本') != -1):
data = data.replace('表情', '')
data = data.replace('文本', '')
result = GetExpression_Search(data)
msg_type = 'text'
text = ''
for i in range(5):
text += result[i][1] + ':' + result[i][0] + '\n'
return text, msg_type
else:
data = data.replace('表情', '')
result = GetExpression_Search(data)
msg_type = 'image'
local = 'c:/wxpublic/temp.gif'
if len(result) != 0:
dowload_photo(result[0][0], local)
img_id = wx.updata_photo(local)
return img_id, msg_type