![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
Hacker_xiao
用心做!
展开
-
Python多线程执行并返回结果
# -*-coding:utf-8-*-import timefrom time import ctime, sleepimport threadingimport collectionsclass MyThread(threading.Thread): def __init__(self, func, args, name=''): threading.T...原创 2020-01-15 18:38:31 · 1117 阅读 · 1 评论 -
Python发送QQ邮件
# coding=utf-8import loggingimport smtplib # 引入SMTP协议包from email.mime.text import MIMETextfrom email.mime.multipart import MIMEMultipart # 创建包含多个部分的邮件体from email.mime.image import MIMEImage# ...原创 2020-01-15 10:03:23 · 182 阅读 · 0 评论 -
Python生成图片验证码
安装PIL包pip install pillow生成验证码代码# 图片验证码import base64import randomfrom PIL import Image, ImageDraw, ImageFontfrom io import BytesIO# 生成随机的子母(大写小写)和数字def getRandomChar(): random_num =...原创 2020-01-14 09:34:58 · 219 阅读 · 0 评论 -
python 列表字典排序
python列表字典数据类型排序:排序方式为:task_info = [{''urgent":"2019-8-26", "task_run_time":"2019-7-23"},..............]task_info = sorted(task_info, key=operator.itemgetter('urgent', 'task_run_time')) #可以以多个字...原创 2019-09-26 12:37:29 · 164 阅读 · 0 评论