2023年7月1日
摘要: 兼容windows和linux的终端执行函数 def shell_exec(cmd: str) -> str: """ 执行终端命令,输出终端打印结果 :param cmd: :return: """ with os.popen(cmd) as fp: bf = fp._stream.buffer. 阅读全文
posted @ 2023-07-01 09:04 CJTARRR 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 使用pip安装scrapy之后可能并不能直接运行,会遇到各种报错,可能是依赖库的版本不兼容导致的,可能需要安装或更新以下依赖: cryptography==38.0.4​pyopenssl==22.0.0​certifi==2023.5.7 在windows python3.8+下的scrapy框架 阅读全文
posted @ 2023-07-01 08:58 CJTARRR 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 表达式名字 = lambda 参数1,参数2,... : 前面参数组成的表达式 举例: add = lambda x,y:x+y add(3,4) 结果为:7 阅读全文
posted @ 2023-07-01 08:41 CJTARRR 阅读(4) 评论(0) 推荐(0) 编辑