12 2024 档案

摘要:安装依赖 pip install python-docx 写入文档函数 def write_to_docx(text, docx_path): os.makedirs(os.path.dirname(docx_path), exist_ok=True) # 创建一个新的Document对象 docu 阅读全文
posted @ 2024-12-28 11:46 二月雪 阅读(8) 评论(0) 推荐(0) 编辑
摘要:安装依赖 pip install mysql-connector-python 自定义公共管理类 import mysql.connector from mysql.connector import Error class MySQLDatabase: def __init__(self, host 阅读全文
posted @ 2024-12-28 10:00 二月雪 阅读(15) 评论(0) 推荐(0) 编辑
摘要:安装依赖库mysql-connector-python pip install mysql-connector-python 执行创建数据库的sql脚本代码 import mysql.connector from mysql.connector import Error def create_dat 阅读全文
posted @ 2024-12-03 09:21 二月雪 阅读(9) 评论(0) 推荐(0) 编辑
摘要:import os import shutil def copy_file(src_file, dst_file): # 如果是文件,进行复制 if os.path.isfile(src_file): _dir = os.path.dirname(dst_file) os.makedirs(_dir 阅读全文
posted @ 2024-12-02 14:19 二月雪 阅读(53) 评论(0) 推荐(0) 编辑

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