随笔分类 -  python

摘要:​ 使用到的知识点:os模块执行linux指令、json.dump()、with open as f 代码实现 import sys import os import json # 向json文件file中添加内容data,其中data的类型为字典 def write_json(file, data 阅读全文
posted @ 2024-07-27 23:45 一只野生的小胖鱼 阅读(322) 评论(0) 推荐(0) 编辑
摘要:1、三种常见的字典遍历实现 def get_key_value(dics): '''遍历所有键值对''' for key, value in dics.items(): print(f"{key}: {value}") def get_keys(dics): ''' 遍历所有的键''' for ke 阅读全文
posted @ 2024-07-27 23:32 一只野生的小胖鱼 阅读(65) 评论(0) 推荐(0) 编辑
摘要:移动并重命名工作簿 1 from pathlib import Path # 导入pathlib模块的path类 2 import time 3 4 # Press the green button in the gutter to run the script. 5 if __name__ == 阅读全文
posted @ 2022-11-13 18:17 一只野生的小胖鱼 阅读(26) 评论(0) 推荐(0) 编辑

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