Tony Tan tonytan748.github.io
1.

Python+Supervisor+Gunicorn+Nginx部署

删除nano12# 在终端输入删除nano编辑器的命令:sudo apt-get remove nano 创建用户123456789sudo adduser xxxxxxchmod -R 640 /etc/sudoerssudo vim /etc/sudoerschmod -R 440 /etc/sudoers或者使用sudo visudo 退出并用x...
2.

Pywebio试用总结

使用手册 功能分类 输入模块 pywebio.input 输出模块 pywebio.output 会话相关 pywebio.session 应用部署 pywebio.platform 持续性输入 pywebio.pin pywebio是一个用python直接渲染web页面的库,主要实现了页面输入,输出的操作,支持多线程/携程. 并且可以整合到主流的...
3.

Python支付宝接口 int() argument must be a string, a bytes-like object or a number, not 'Sequence'错误

调用支付宝授权接口,公钥模式,请求结果报12345678910111213[ef2a59c2-4b73-11ec-ab9c-00163e131b46]requst sign failed. int() argument must be a string, a bytes-like object or a number, not 'Sequen...
4.

Python第三方字典模块:Addict 模块

转载自这里 Addit 是一个Python模块,除了提供标准的字典语法外,Addit 生成的字典的值既可以使用属性来获取,也可以使用属性进行设置。 这意味着你不用再写这样的字典了: 123456789101112body = { 'query': { 'filtered':...
5.

用python绘制太极图

不多说,直接上代码: 1234567891011121314151617181920212223242526272829303132import turtle as tt.setup(800, 800, 0, 0)t.pensize(1.5)t.pu()t.goto(0,-300)t.pd()t.fillcolor("black")...
6.

装饰器的六种写法

介绍装饰器本质上是一个Python函数,它可以让其他函数在不需要做任何代码变动的前提下增加额外功能,装饰器的返回值也是一个函数对象。 它经常用于有切面需求的场景,比如:插入日志、性能测试、事务处理、缓存、权限校验等场景。 装饰器是解决这类问题的绝佳设计,有了装饰器,我们就可以抽离出大量与函数功能本身无关的雷同代码并继续重用。 装饰器的使用方法很固定 ...
7.

How to set up a perfect Python project

This blog is from here When starting a new Python project, it is tempting to just dive in and start coding. Spending a tiny amount of time to setup a project with the best tools...
8.

Python datetime模块介绍及示例

转载自这里 datetime模块介绍datetime模块中包含如下类: 类名 功能说明 date 日期对象,常用的属性有year, month, day time 时间对象 datetime 日期时间对象,常用的属性有hour, minute, second, microsecond datetime_CAPI 日期时间对象C语...
9.

python calendar

Calendar setfirstweekday(firstweekday) 指定一周的第一天,0是星期一,… 6为星期日 firstweekday():返回一周的第一天,0是星期一,…,6为星期日 isleap(year):判断指定是否是闰年,闰年为True,平年为False leapdays(y1, y2):返回y1与y2年份之间的闰年数量...
10.

Python group function (groupby, itertools)

If the strucutre of data is:1234567d1={'name':'zhangsan','age':20,'country':'China'}d2={'name':'w...