
python
_古时候
隐匿千年
任时光流转
兀自岿然不动
是离离原上的村庄
一砖一瓦上的创造荣光
撞见丛林秘境内的生命秩序
遇见纯粹目光中的道法自然
在追根溯源中
看见血液中与生俱来的骄傲
展开
-
python socket
python socket转载 2022-06-21 18:17:42 · 103 阅读 · 0 评论 -
python logging模块初步使用
【代码】python logging模块初步使用。原创 2022-05-12 09:13:43 · 903 阅读 · 2 评论 -
使用Python来操作邮箱
一.邮箱为软件的介入添加了接口,比如我们的邮箱验证,邮箱登录,不过前提是需要我们对其进行配置,一下以QQ邮箱和网易邮箱为例:QQ邮箱:首先点击设置按钮QQ邮箱:选中账户选项卡QQ邮箱:找到这项服务QQ邮箱:然后按照提示发送短信到指定号码,获得授权码二.代码发送邮件的具体实现#smtp =>simple mail transfer protocol...原创 2018-08-10 20:00:35 · 13652 阅读 · 0 评论 -
【实用技巧】
python列表展平s = [1, [2, [3, [4, [5, 6], 7], 8], (9, 0)]]f = lambda x: [y for _x in x for y in f(_x)] if isinstance(x, (list, tuple)) else [x]print(f(s)) # [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]numpy数组转一维data.flatten()data.reshape()原创 2022-02-28 16:34:06 · 304 阅读 · 0 评论 -
matplotlib显示中文乱码
解决matplotlib显示中文乱码的问题1、执行以下两行确定matplotlib字体的位置import matplotlib print(matplotlib.matplotlib_fname())- 2、把 *.ttf 移入字体文件夹内 - 3、设置plt.rcParams['font.sans-serif'] = ['SimHei'] # 字体名称要对应...原创 2021-06-08 16:03:56 · 134 阅读 · 0 评论 -
Python Django发送邮件
经常我们登陆一些网站或者软件都会出现短信验证或者邮箱验证,今天来初步了解一下邮箱验证的实现。路由配置等这里不再介绍,具体的邮箱设置请参考我以前的博客https://blog.youkuaiyun.com/qq_38059635/article/details/81569081设置邮箱以及获得授权码from django.shortcuts import renderfrom django...原创 2021-01-19 20:14:58 · 494 阅读 · 0 评论 -
python 多线程实例
方式一import requestsimport threadingdef get_stock(code): url = 'http://hq.sinajs.cn/list=' + code resp = requests.get(url) print('%s\n' % resp.text)#多线程异步,加速抓取#根据有几个股票代码,就创建几个线程codes...原创 2019-07-15 19:58:50 · 281 阅读 · 0 评论