摘要:
python的日志使用装饰器 log.py import logging from functools import wraps import os # 1. 日志配置(创建日志文件) LOG_FILENAME = 'function_calls.log' # 确保在开始时清除旧日志文件,便于演示 阅读全文
posted @ 2025-11-27 23:27
漫漫长路</>
阅读(4)
评论(0)
推荐(0)
摘要:
import json def write_json_file(data): #写入json with open("data.json", "w") as data_file: json.dump(data, data_file) def read_json_file(data): with ope 阅读全文
posted @ 2025-11-27 21:42
漫漫长路</>
阅读(4)
评论(0)
推荐(0)
摘要:
import csv import os def save_to_csv(book_list): with open('books.csv','w',newline='', encoding='utf-8-sig') as csvfile: writer=csv.DictWriter(csvfile 阅读全文
posted @ 2025-11-27 21:33
漫漫长路</>
阅读(2)
评论(0)
推荐(0)

浙公网安备 33010602011771号