09 2021 档案
摘要:方法:重写Thread类,在类中添加一个flag判断子线程是否出现异常 import threading import traceback class ExcThread(threading.Thread): def __init__(self, target, args, kwargs): sup
阅读全文
摘要:app.py文件 创建项目、设置路由、启动项目 from flask import Flask from flask_restful import Api from concurrent.futures import ThreadPoolExecutor executor = ThreadPoolE
阅读全文
摘要:import pandas as pd # 先装个pandas ,pip install pandas import pymysql # 读入数据库 filename = 'student.xlsx' # 本地需要导入数据库的文件 data = pd.read_excel(filename) # 建
阅读全文
摘要:使用openpyxl库 from openpyxl import Workbook import pymysql con = pymysql.connect(host="127.0.0.1", port=3306, user="root", passwd="***", db="student",ch
阅读全文
摘要:logging模块 import logging logging.basicConfig(level=logging.DEBUG, format="%(message)s %(asctime)s",datefmt="%Y-%m-%d %H:%M:%S") #level:日志报错级别 format:日
阅读全文

浙公网安备 33010602011771号