python
qq_45427714
这个作者很懒,什么都没留下…
展开
-
celery启动 beat和worker
beat启动celery beat -A project_name --loglevel=DEBUGworker启动celery worker -A project_name -c2 --loglevel=DEBUG-c 参数代表是几个并发子进程数量 默认cpu个数原创 2022-05-30 16:40:52 · 967 阅读 · 0 评论 -
获取当前运行方法名称和注释
只能在非类下的函数获取,类里面的方法获取不到注释,但是同样可以获取到方法名称原创 2021-12-27 14:46:59 · 302 阅读 · 0 评论 -
python自带web服务启动
这个是python3的语法, 后面可以加上端口 不加默认8000python -m http.serverpython2语法 后面可以加上端口 不加默认8000python -m SimpleHTTPServer原创 2021-01-11 14:29:07 · 510 阅读 · 0 评论 -
python(时间模块)time
日期时间格式字符串列表:%a 星期几的简写;如 星期三为Web%A 星期几的全称;如 星期三为Wednesday%b 月份的简写; 如4月份为Apr%B 月份的全称; 如4月份为April%c 标准的日期的时间串;(如: 04/07/10 10:43:39)%C 年份的后两位数字%d 十进制表示的每月的第几天%D 月/天/年%e 在两字符域中,十进制表示的每月的第几天%F 年-...原创 2020-12-03 13:44:18 · 140 阅读 · 0 评论 -
win10子系统打包python项目,Python library not found: libpython3.6.so.1.0,No such file or directory:objdump
python打包过程中遇到了两个问题,记录一下OSError: Python library not found: libpython3.6.so.1.0, libpython3.6mu.so.1.0, libpython3.6m.so.1.0This would mean your Python installation doesn't come with proper library files.This usually happens by missing development pack原创 2020-09-07 17:16:25 · 800 阅读 · 0 评论 -
python图片透明和有背景互相转换
用PIL库实现,传入图片地址from PIL import Imagedef transparent_back(img_path): img = img.convert('RGBA') L, H = img.size color_0 = img.getpixel((0,0)) for h in range(H): for l in range(L): dot = (l,h) color_1 = img.ge原创 2020-08-17 16:35:08 · 733 阅读 · 0 评论 -
python第三方包国内镜像网址
python国内镜像转载 2019-11-16 12:11:52 · 1562 阅读 · 0 评论 -
celery在windows10下使用
环境 : python3.6django2.2celery4.3需要安装eventlet库pip install eventlet运行celery在后面多加上一个参数 -P eventletcelery -A celery_tasks.tasks worker -l info -P eventlet原创 2019-11-16 11:12:14 · 1195 阅读 · 1 评论 -
django2.2版本reverse导入问题
之前导入 :from django.core.urlresolvers import reverse这样就可以了2.2版本就不可以了解决:from django.urls import reverse原创 2019-11-15 16:13:53 · 579 阅读 · 0 评论 -
python学习网络传输
UDP传输无需连接的传输协议。UDP提供了无连接通信,且不对传送数据包进行可靠性保证,适合于一次传输少量数据,UDP传输的可靠性由应用层负责。不是特别安全,不能保证送达。没有流量字段的限制。因为UDP协议控制选项较少,所以传输速度快,效率高,适合对可靠性要求不高的应用程序,或者可以保障可靠性的应用程序。可以用作广播。...原创 2019-11-08 09:14:37 · 135 阅读 · 0 评论 -
csv文件写入和编码问题
错误信息UnicodeEncodeError: ‘gbk’ codec can’t encode character ‘\u25ba’ in position 494: illegal multibyte sequence这和python2.的解决方法是不一样的,百度之后总结出来供大家互相学习。python3.的应该都可以借鉴。1.出现UnicodeEncodeError 说明是Unicod...原创 2019-11-08 09:13:09 · 2081 阅读 · 0 评论