
Python
暮雨疏桐
爱搬砖的伪文艺女青年
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python 异步执行测试
本文介绍了使用asyncio库实现并行执行和任务调度的机制。通过asyncio.create_subprocess_exec启动外部命令,每个命令在独立的系统进程中运行,实现真正的并行执行。主程序通过asyncio的事件循环管理子进程的启动和输出处理,实现异步非阻塞调度。任务调度规则通过asyncio.Semaphore(N)控制,最多同时启动N个子进程,动态填补完成的任务。示例代码展示了如何设置并发数为3,并验证了任务调度的行为,确保最多3个任务并行执行,其他任务在子进程完成后立即启动。测试结果直观展示了原创 2025-05-14 14:28:40 · 396 阅读 · 0 评论 -
记录下Charles 抓包tiktok遇到的坑,以及调查关于 SSL unpinning 中增长的皮毛知识
tiktok Charles 抓包, https unknown, SSL unpinning原创 2023-03-17 15:16:04 · 2698 阅读 · 1 评论 -
python selenium webdriver 基础使用
【代码】python selenium webdriver 基础使用。原创 2024-03-06 16:03:58 · 452 阅读 · 0 评论 -
python 文本进度条
def textProBar(count, lstLen, start_time): persent = int((count/lstLen)*100) scale = 100 star = '*' * persent dot = '.' * (scale - persent) dur = time.perf_counter() - start_time print("\r{:>3.0f}%[{}->{}]{:.2f}s".format(pers...原创 2021-02-01 16:55:54 · 347 阅读 · 0 评论 -
python 正则表达式符号说明
原创 2021-02-01 13:29:08 · 188 阅读 · 0 评论 -
python requests库基本使用
Requests库的安装Win操作系统: 以管理员身份运行 cmd, 执行 pip install requests Requests库的7个主要方法# 爬取网页的通用代码框架import requestsdef getHTMLText(url): try: r = requests.get(url, timeout=30) r.raise_for_status() # 如果状态不是200,引发HTTPE...原创 2021-01-27 12:28:25 · 206 阅读 · 0 评论 -
python 2.x 和 3.x共存的情况下,给 3.x安装第三方库
首先,进入3.x所在目录我的在 D:/tool/python3.8.5然后执行 python.exe -m pip install 第三方库名原创 2021-01-27 09:56:41 · 177 阅读 · 0 评论 -
Python 集合数据类型
原创 2021-01-18 09:45:15 · 94 阅读 · 0 评论 -
Python time库的基础使用
time库包含三类函数1. 时间获取time() # 获取当前时间戳ctime() # 获取当前时间,并以易读的方式表示gmtime() # 获取当前时间,表示为计算机可处理的时间格式>>> import time>>> time.time()1610413175.6031203>>> time.ctime()'Tue Jan 12 09:59:44 2021'>>> time.gmtime()time原创 2021-01-12 09:43:51 · 140 阅读 · 0 评论 -
python 浮点数类型
浮点数间运算存在不确定尾数,这不是bug# 浮点数间运算存在不确定尾数>>> 0.1+0.20.30000000000000004>>> 0.1+0.30.4>>> 所以,浮点数间比较要使用 round 函数>>> 0.1+0.2 == 0.3False>>> round(0.1+0.2, 1) == 0.3True>>> ...原创 2021-01-11 15:06:16 · 4848 阅读 · 2 评论 -
微博使用Python SDK爬取数据
Python SDK安装步骤,请参考我的上一篇文章:微博Python SDK 发微博1. 爬取微博及对应的评论微博接口为:statuses/user_timeline评论接口为:comments/showfrom weibo import APIClient APP_KEY = '1234567' # app keyAPP_SECRET = 'abcdefghijklmn' # app secretCALLBACK_URL = 'http://www.example.com/cal原创 2020-06-16 15:42:28 · 752 阅读 · 0 评论 -
微博Python SDK 发微博
微博API接口List:https://open.weibo.com/wiki/%E5%BE%AE%E5%8D%9AAPI发微博所用接口:https://open.weibo.com/wiki/2/statuses/share各种SDK List:https://open.weibo.com/wiki/SDKPython SDK使用文档:https://github.com/michaelliao/sinaweibopy/wiki/OAuth2-HOWTOps:该文档的发送微原创 2020-06-15 16:14:10 · 540 阅读 · 0 评论 -
命令行查看python的安装路径
打开cmd键入where pythonwhere python原创 2018-12-19 14:38:26 · 7140 阅读 · 2 评论