![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python useful
文章平均质量分 55
ltoddy
http://algo.site
展开
-
Python发送电子邮件.
源代码:https://github.com/ltoddy/Python-usefulsendemail.pyimport smtplibfrom email.mime.text import MIMETextmsg = MIMEText('The body of the email is here') # 这里是你的信件中的内容msg['From'] = 'ltoddy@163.com'原创 2017-10-28 14:18:18 · 5525 阅读 · 0 评论 -
markdown转换html
源代码:https://github.com/ltoddy/Python-usefulmarkdowntohtml.pyimport sysimport argparseimport markdownparser = argparse.ArgumentParser()parser.add_argument('-f', '--filename', help='你的markdown文件名(.md为原创 2017-10-28 14:22:47 · 927 阅读 · 0 评论 -
谢尔宾斯基三角形GUI
源代码:https://github.com/ltoddy/Python-usefulsierpinskitriangle.pyfrom tkinter import *class SierpinskiTriangle: def __init__(self): window = Tk() window.title("Sierpinski Triangle")原创 2017-10-29 09:05:44 · 2422 阅读 · 0 评论 -
通过pip,更新电脑上全部的依赖库.
源代码:https://github.com/ltoddy/Python-usefulupdate.pyimport pipfrom subprocess import callfor dist in pip.get_installed_distributions(): call('pip install --upgrade ' + dist.project_name, shell=Tr原创 2017-10-24 17:44:54 · 1779 阅读 · 0 评论 -
Python线程池
一次运行一个任务:from concurrent.futures import ThreadPoolExecutordef foo(a, b): print(a) print(b)# executor = ThreadPoolExecutor(max_workers=1)# executor.submit(foo)# executor.shutdown()with Thre原创 2017-12-03 10:06:19 · 382 阅读 · 0 评论 -
PEP8 Python 编码规范整理
原文链接:https://github.com/ltoddy/Python-usefulPEP8 Python 编码规范整理### 代码编排 缩进:4个空格的缩进(编辑器都可以完成此功能),不使用Tap,更不能混合使用Tap和空格。每行最大长度79,换行可以使用反斜杠,最好使用圆括号。换行点要在操作符的后边敲回车。类和top level function定义之间空两行;类中的方法定义之间空一原创 2017-11-24 21:01:50 · 485 阅读 · 0 评论 -
基于docker+gunicorn部署sanic项目
基于docker+gunicorn部署sanic项目源代码: https://github.com/ltoddy/Python-useful/tree/master/sanic-app最近云服务提供商在打价格战,我在滴滴云上花了很少的钱租了一个月的云服务器: 公网ip是: 116.85.42.182, 以下我以116.85.42.182这个ip为演示,当你自己在部署的时候请换乘自己的ip...原创 2018-04-12 17:58:10 · 1020 阅读 · 0 评论