python读写json文件
dumps()
将一个python对象编码为json对象
loads()
讲一个json对象解析为python对象
↑ 用于python和json格式转换
↓ 用于读写json
dump()
将python对象写入文件
load()
从文件中读取json数据
shutil
核心代码
import shutil
shutil.copytree(source_path, target_path) # 文件夹整体拷贝
shutil.copy(src_file_path, target_path) # 拷贝,只用是
shutil.copyfile(src_file_path, target_file_path) # 拷贝,注意必须是file path
shutil.move(src_file_path, target_path) # 移动文件 ⭐