摘要: 多进程和多线程 from multiprocessing import Process import threading def process_worker(): for i in range(200): print(f"Process worker {i}") def thread_worker 阅读全文
posted @ 2024-07-04 20:33 noahze 阅读(15) 评论(0) 推荐(0) 编辑
摘要: HTML文本处理 re模式匹配 正则表达式是一种强大的字符串匹配和处理工具,允许通过指定的模式来查找、替换和验证字符串。 函数 编译正则表达式 re.compile(pattern, flags=0): 将字符串形式的正则表达式编译为一个正则对象,用于后续的匹配操作。 匹配操作 re.match(p 阅读全文
posted @ 2024-07-04 17:40 noahze 阅读(2) 评论(0) 推荐(0) 编辑
摘要: requests库 requests 提供发送网络请求和处理响应的方法 安装 pip install requests GET 请求 import requests url = 'https://www.baidu.com/' # url params = {'key1': 'value1', 'k 阅读全文
posted @ 2024-07-04 17:33 noahze 阅读(1) 评论(0) 推荐(0) 编辑