随笔分类 -  小脚本

python 发送带各种附件的邮件示例
摘要:简述下如何使用python发送各种附件的邮件,比如word、excel、pdf、txt,以及在正文插入图片等等 # coding=utf-8 import smtplib from email.mime.text import MIMEText from email.header import He 阅读全文

posted @ 2021-06-16 09:46 不要挡着我晒太阳 编辑

python验证企业统一信用码
摘要:_credit_id_weight = ( 1, 3, 9, 27, 19, 26, 16, 17, 20, 29, 25, 13, 8, 24, 10, 30, 28) def _is_credit_id_valid(oid: str) -> bool: if not isinstance(oid 阅读全文

posted @ 2020-04-10 15:46 不要挡着我晒太阳 阅读(303) 评论(0) 推荐(0) 编辑

python验证身份证
摘要:_natual_id_weight = (7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2) def _is_natural_id_valid(oid: str) -> bool: if not isinstance(oid, str) or l 阅读全文

posted @ 2020-04-10 15:37 不要挡着我晒太阳 阅读(604) 评论(0) 推荐(0) 编辑

Python自动群发邮件
摘要:import smtplib from email import (header) from email.mime import (text, application, multipart) import time def sender_mail(): smt_p = smtplib.SMTP() 阅读全文

posted @ 2020-04-02 16:59 不要挡着我晒太阳 阅读(346) 评论(0) 推荐(0) 编辑

数据库字段名批量转化为驼峰格式
摘要:import re def camel(s): s = re.sub(r"(\s|_|-)+", " ", s).title().replace(" ", "") return s[0].lower() + s[1:] # 批量转化 def batch_camel(slist): return [c 阅读全文

posted @ 2020-03-31 15:38 不要挡着我晒太阳 阅读(1103) 评论(0) 推荐(0) 编辑

生成requirements的脚本
只有注册用户登录后才能阅读该文。

posted @ 2020-03-26 19:29 不要挡着我晒太阳 阅读(0) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 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 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示