diff --git a/19100105/liwanlsl/README.md b/19100105/liwanlsl/README.md index 3e08f31d2..d6870389c 100644 --- a/19100105/liwanlsl/README.md +++ b/19100105/liwanlsl/README.md @@ -1,4 +1,4 @@ - + 第1天 姓名:李树立 所属班级:19100105 @@ -77,3 +77,11 @@ issue 学习用时:3.5小时 总结收获:知道了微信“机器人”,简单尝试一次。在GIT中,对用法很详细了,只要认真读,都能很快上手的。 遇到的难点和问题:新的工具开始总用的不熟,需要一点点调试。过程中重要的是耐心。 + + +第13天 +姓名:李树立 +所属班级:19100105 +学习用时:5.5小时 +总结收获:学习了简单可视化并反馈给分享者。 +遇到的难点和问题:反馈过程仍出现些问题,后续需要继续处理。 diff --git "a/19100105/liwanlsl/d11_training1 - \345\211\257\346\234\254.py" "b/19100105/liwanlsl/d11_training1 - \345\211\257\346\234\254.py" index 5e48f2c73..ad091b5ff 100644 --- "a/19100105/liwanlsl/d11_training1 - \345\211\257\346\234\254.py" +++ "b/19100105/liwanlsl/d11_training1 - \345\211\257\346\234\254.py" @@ -16,9 +16,9 @@ statString = ''.join(str(i) for i in statList) print(statString) -sender = input('输入发件人邮箱:' '176665323@qq.com') -password = getpass.getpass('输入发件人邮箱密码:' 'pwfpmmgsajmjbghg') -recipients = input('输入收件人邮箱:' 'pythoncamp@163.com') +sender = input('输入发件人邮箱:') +password = getpass.getpass('输入发件人邮箱密码:') +recipients = input('输入收件人邮箱:') smtp = 'smtp.qq.com' yagmail.SMTP(sender,password,smtp).send(recipients,'19100105 liwanlsl',statString) diff --git a/19100105/liwanlsl/d11_training1.py b/19100105/liwanlsl/d11_training1.py index 8dde90c21..ae7925f26 100644 --- a/19100105/liwanlsl/d11_training1.py +++ b/19100105/liwanlsl/d11_training1.py @@ -7,7 +7,7 @@ # 获取公众号文件 - +response = requests.get('https://mp.weixin.qq.com/s/pLmuGoc4bZrMNl7MSoWgiA') # 提取公众号正文 def stats(url): diff --git a/19100105/liwanlsl/d12_training2.py b/19100105/liwanlsl/d12_training2.py index ff9d60abf..6bccedd31 100644 --- a/19100105/liwanlsl/d12_training2.py +++ b/19100105/liwanlsl/d12_training2.py @@ -2,8 +2,8 @@ import d11_training1 bot = Bot() -my_friend = bot.friends().search('家')[0] -my_friend.send('分享') +my_friend = bot.friends().search('wan')[0] +my_friend.send('发一个链接') @bot.register(my_friend) diff --git a/19100105/liwanlsl/d13_training3.py b/19100105/liwanlsl/d13_training3.py new file mode 100644 index 000000000..87f0b0140 --- /dev/null +++ b/19100105/liwanlsl/d13_training3.py @@ -0,0 +1,56 @@ + +import matplotlib.pyplot as plt +import numpy as np + +plt.rcdefaults() +fig,ax = plt.subplots() + +def matplt (Xname,Ynum): + y_pop = range(len(Ynum)) + + ax.bar(y_pop, Ynum,tick_label=Xname,align='center', + color='green', ecolor='black') + ax.set_ylabel('CIPIN') + ax.set_xlabel('CIHUI') + ax.set_title('WEN ZHANG FAN KUI:') + + plt.savefig('C:/Users/admin/frcy.png') + plt.show() + +from wxpy import * + +bot = Bot(cache_path=True) + +my_friend = bot.friends().search('李')[0] + +@bot.register(my_friend) + +def get_msg(msg): + if msg.type == 'Sharing': + target = msg.url + + import requests + import yagmail + import getpass + from pyquery import PyQuery + from mymodule import d11_stats_word + + response = requests.get('target') + + document = PyQuery (response.text) + content = document ('#js_content').text() + + statList = d11_stats_word.stats_text(content) + content1 = ''.join(str(i) for i in statList) + + cipin_list=[] + cihui_list=[] + for i in content1: + cihui_list.append(i[0]) + cipin_list.append(i[1]) + + matplt(cihui_list,cipin_list) + my_friend.send_image('C:/Users/admin/frcy.png') + + +embed() diff --git a/19100105/liwanlsl/mymodule/d11_stats_word.py b/19100105/liwanlsl/mymodule/d11_stats_word.py index 8752fe884..d4dc4b413 100644 --- a/19100105/liwanlsl/mymodule/d11_stats_word.py +++ b/19100105/liwanlsl/mymodule/d11_stats_word.py @@ -22,7 +22,7 @@ def stats_text_cn(cn) : else : pass - return collections.Counter(SHList).most_common(100) + return collections.Counter(SHList).most_common(20) def stats_text(text): ''' 合并英汉词频统计 '''