随笔分类 -  python

摘要:Flask + 多进程 + 协程了。 8核虚拟机最高QPS高达1W5。 使用的时候务必注意一下 “”“进程“”“ 安全就行了。 参考代码如下,[Flask gevent 多进程WSGI(非gunicorn)](https://cpp.la/439.html) ``` shell # coding: 阅读全文
posted @ 2023-09-01 14:11 左岸丶 阅读(800) 评论(0) 推荐(0) 编辑
摘要:使用pyinstall进行多个文件打包,直接打包主入口文件即可 pyinstaller main.py -F -n test -i 1.ico -w 此处main.py即为工程文件入口文件(主程序入口) -F即为生成文件只有一个EXE文件,编译打包成功后存放在dist文件目录 -n test即打包后 阅读全文
posted @ 2023-03-03 20:42 左岸丶 阅读(384) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/hls-code/p/15393575.html 阅读全文
posted @ 2022-08-16 18:20 左岸丶 阅读(14) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/Dby_freedom/article/details/80214171 阅读全文
posted @ 2022-08-05 17:47 左岸丶 阅读(284) 评论(0) 推荐(0) 编辑
摘要:文件格式问题,windows上的格式与linux不同 vim 文件 set:ff=unix https://blog.csdn.net/weixin_53060366/article/details/125824934 阅读全文
posted @ 2022-08-05 11:53 左岸丶 阅读(51) 评论(0) 推荐(0) 编辑
摘要:也就是说,和typing这module里面其他东西的功能一样,@overload装饰器其实只是一种注解/提示:该函数允许传入不同的参数类型组合。最终,所有加了@overload装饰器的方法都会被一个不加装饰器的方法覆盖掉。如 from typing import overload class Duc 阅读全文
posted @ 2022-07-22 14:12 左岸丶 阅读(1113) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/u010799534/article/details/125429064 阅读全文
posted @ 2022-07-15 17:52 左岸丶 阅读(28) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/chao-sir/articles/10828811.html https://www.cnblogs.com/xiao-xue-di/p/13524127.html 阅读全文
posted @ 2022-07-12 14:43 左岸丶 阅读(12) 评论(0) 推荐(0) 编辑
摘要:Python常用命令行参数 -V 参数,输出Python的版本,或者--version -u 参数,在print记录时候很有用,使用这个参数 会强制 stdin, stdout 和 stderr变为无缓冲的,会立刻输出出来,而不是等缓冲区满了才会打印数据。 -c 参数,直接运行python语句 -B 阅读全文
posted @ 2022-07-08 17:53 左岸丶 阅读(391) 评论(0) 推荐(0) 编辑
摘要:首先要清楚python中的print语句就是调用sys.stdout.write() 然后python还有一种输出是sys.stderr.write() python缓存机制,虽然stderr和stdout默认都是指向屏幕的,但是stderr是无缓存的,程序往stderr输出一个字符,就会在屏幕上显 阅读全文
posted @ 2022-04-12 13:39 左岸丶 阅读(321) 评论(0) 推荐(0) 编辑
摘要:from loguru import logger logger.add('project_name.log', rotation="50 MB") logger.debug("message") https://www.cnblogs.com/ice-coder/p/12821326.html h 阅读全文
posted @ 2022-04-02 17:03 左岸丶 阅读(31) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/subic/p/6553187.html 阅读全文
posted @ 2022-04-02 14:58 左岸丶 阅读(17) 评论(0) 推荐(0) 编辑
摘要:super() 函数是用于调用父类(超类)的一个方法。 super() 是用来解决多重继承问题的,直接用类名调用父类方法(A.init()或者A.add())在使用单继承的时候没问题,但是如果使用多继承,会涉及到查找顺序(MRO)、重复调用(钻石继承)等种种问题。 MRO 就是类的方法解析顺序表, 阅读全文
posted @ 2022-04-02 10:42 左岸丶 阅读(48) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/Y-HKL/p/6579571.html https://blog.csdn.net/qq_33808544/article/details/104146039 阅读全文
posted @ 2022-01-14 11:50 左岸丶 阅读(31) 评论(0) 推荐(0) 编辑
摘要:import requests url = "http://?????.com/SvltLogin" s = requests.session() #建立一个Session response = s.post(url, data={"txtUsr_id": "00000001", "txtPassw 阅读全文
posted @ 2021-12-24 11:58 左岸丶 阅读(35) 评论(0) 推荐(0) 编辑
摘要:Python通过重写sys.stdout将控制台日志重定向到文件 class Logger(object): def __init__(self,fileN ="Default.log"): self.terminal = sys.stdout self.log = open(fileN,"a") 阅读全文
posted @ 2021-10-29 16:41 左岸丶 阅读(639) 评论(0) 推荐(0) 编辑
摘要:import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) https://www.jb51.net/article/165359.htm 阅读全文
posted @ 2021-10-22 11:25 左岸丶 阅读(75) 评论(0) 推荐(0) 编辑
摘要:@seldom.file_data("test_data/device/device.yaml", key="test_importDevice") @seldom.skip("ok") def test_importDevice(self, file_path, code, device_name 阅读全文
posted @ 2021-10-08 14:28 左岸丶 阅读(156) 评论(0) 推荐(0) 编辑
摘要:python类的继承 阅读全文
posted @ 2021-08-29 20:44 左岸丶 阅读(11) 评论(0) 推荐(0) 编辑
摘要:函数sort进行排序,在本地进行排序,不返回副本 函数sorted进行排序,返回副本,原始输入不变 sort >>> help(list.sort) Help on method_descriptor: sort(...) L.sort(cmp=None, key=None, reverse=Fal 阅读全文
posted @ 2021-08-05 15:01 左岸丶 阅读(292) 评论(0) 推荐(0) 编辑

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