上一页 1 2 3 4 5 6 7 ··· 13 下一页
  2024年3月14日
摘要: mac: /Users/用户名/Library/Application Support/JetBrains/ windows: C:\Users\xxxxxxx\AppData\Roaming\JetBrains\ Ubuntu18.04: ~/.config/JetBrains/​# vmopti 阅读全文
posted @ 2024-03-14 17:13 CJTARRR 阅读(74) 评论(0) 推荐(0) 编辑
  2024年2月27日
摘要: 示例 """程序运行计时工具"""import signal​​class TimeoutException(Exception): def __str__(self) -> str: return "程序运行超时"​​def timeout_handler(signum, frame): """ 阅读全文
posted @ 2024-02-27 10:25 CJTARRR 阅读(118) 评论(0) 推荐(0) 编辑
  2024年2月10日
摘要: 1.安装 pip install loguru 2.简单使用from loguru import logger logger.debug("xxx")logger.info("xxx")logger.waring("xxx")... 3.add函数logger的add函数可以配置Handler、Fo 阅读全文
posted @ 2024-02-10 20:21 CJTARRR 阅读(53) 评论(0) 推荐(0) 编辑
  2024年1月22日
摘要: # 当python使用redis库连接和使用redis数据库时,可能会偶尔发生标题中的错误。这种操作并不是每次都会发生,而是偶发的,并且重试可以解决。# 为了连接使用更稳定简单,在redis 3.3.x后,redis库作者为redis客户端添加了一个health_check_interval参数,用 阅读全文
posted @ 2024-01-22 09:23 CJTARRR 阅读(253) 评论(0) 推荐(0) 编辑
  2024年1月2日
摘要: 用requests请求一下网址均可: http://jsonip.com http://httpbin.org/get 阅读全文
posted @ 2024-01-02 17:23 CJTARRR 阅读(35) 评论(0) 推荐(0) 编辑
摘要: Python importlib简单使用 查看包/文件是否存在 from importlib import util​spec = util.find_spec("xxx.xxx.xxx") # 填目标包/文件的引用路径if not spec: print("没有找到相关的包/文件") 导入包/文件 阅读全文
posted @ 2024-01-02 17:07 CJTARRR 阅读(68) 评论(0) 推荐(0) 编辑
摘要: python设置全局socks5代理 安装pysocks pip install pysocks 实现方法 import socksimport socket​​def up_global_proxy(host: str, port: int, username: str=None, passwor 阅读全文
posted @ 2024-01-02 11:55 CJTARRR 阅读(436) 评论(0) 推荐(0) 编辑
  2023年12月29日
摘要: 当通过相对路径写入或引用文件时,需要注意当前工作目录: # 查看当前工作目录 import os print(os.getcwd()) # 修改工作目录 os.chdir(路径) 阅读全文
posted @ 2023-12-29 10:57 CJTARRR 阅读(5) 评论(0) 推荐(0) 编辑
  2023年12月20日
摘要: python安装anyjson时报错: error in anyjson setup command: use_2to3 is invalid. 原因是setuptools 58之后的版本已废弃use_2to3 解决办法是,安装低版本的setuptools pip install setuptool 阅读全文
posted @ 2023-12-20 14:54 CJTARRR 阅读(519) 评论(0) 推荐(0) 编辑
  2023年12月12日
摘要: import platform PLATFORM_SYS = platform.system().lower() # 获得当前平台系统类型名称# linux系统,PLATFORM_SYS = "linux"# windows系统,PLATFORM_SYS = "windows"# mac系统,PLA 阅读全文
posted @ 2023-12-12 11:17 CJTARRR 阅读(29) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 13 下一页