01 2024 档案

摘要:import csv import json # 常规csv表格转换为json文件,表头作为字典key字段。 def convert_csv_to_json(csv_file_path, json_file_path): data = [] with open(csv_file_path, 'r', 阅读全文
posted @ 2024-01-21 15:16 冷夜O 阅读(5) 评论(0) 推荐(0) 编辑
摘要:from retrying import retry r''' 安装:pip install retrying Version: 1.3.4 作用:retrying库是Python中用于实现重试机制的库,它们的目的都是在遇到错误或异常时自动重试代码块,以增加代码的健壮性和可靠性. 下面的案例抽几个常 阅读全文
posted @ 2024-01-16 21:23 冷夜O 阅读(49) 评论(0) 推荐(0) 编辑
摘要:# 删除文件 import os os.remove('/path') # 删除文件夹(不为空也可以删除) import shutil shutil.rmtree('path') 阅读全文
posted @ 2024-01-08 17:35 冷夜O 编辑

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