摘要: 导包 import datetime from pathlib import Path import pytz from exchangelib import ( Configuration, Account, DELEGATE, Q, Credentials, HTMLBody, Message, 阅读全文
posted @ 2024-02-06 10:25 cnblogs用户 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 不使用logging模块,只是简单的输出某一个函数的异常信息 # coding:utf-8 import sys import pandas as pd def test(): try: pd.DataFrame('') except ValueError: error_msg = '执行异常![{ 阅读全文
posted @ 2023-12-27 10:54 cnblogs用户 阅读(24) 评论(0) 推荐(0) 编辑
摘要: html_doc = """ <html><head><title>The Dormouse's story</title></head> <body> <p class="title"><b>The Dormouse's story</b></p> <p class="story">Once up 阅读全文
posted @ 2023-12-06 16:48 cnblogs用户 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 效果展示 原始文件 划线后文件 代码实现 # coding:utf-8 import os from win32com.client import Dispatch def get_string_index(substring, string): """ 获取同一字符串中的多个相同字符串的起始索引 阅读全文
posted @ 2023-12-05 14:37 cnblogs用户 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 效果展示 原始文件 划线后文件 代码实现 # coding:utf-8 import os import fitz # PyMuPDF def pdf_underline_text(pdf_path, search_text, output_path=None): """ 在PDF文件中指定的文字下 阅读全文
posted @ 2023-12-05 14:35 cnblogs用户 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 方法一:xlwings import os.path import uuid from io import BytesIO from typing import Union import xlwings as xw from PIL import ImageGrab def excel_grab(e 阅读全文
posted @ 2023-12-04 13:29 cnblogs用户 阅读(847) 评论(0) 推荐(0) 编辑
摘要: 本地yum源 上传centos镜像至linux系统 # 使用xftp工具上传 # scp上传 创建iso挂载目录 mkdir /mnt/yum-iso 挂载系统镜像 mount -o loop /opt/CentOS-7.xxxxx.iso /mnt/yum-iso/ 移走原有的yum源 cd /e 阅读全文
posted @ 2023-10-18 14:40 cnblogs用户 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 参数说明 -F, –onefile | 打包一个单个文件,如果你的代码都写在一个.py文件的话,可以用这个,如果是多个.py文件就别用 -D, –onedir | 打包多个文件,在dist中生成很多依赖文件,适合以框架形式编写工具代码 -w, –windowed,–noconsole | 使用Win 阅读全文
posted @ 2023-09-21 09:21 cnblogs用户 阅读(185) 评论(0) 推荐(0) 编辑
摘要: ```python import re import os import email from email.header import decode_header from email.utils import parsedate_to_datetime def parse_eml(eml_fp, 阅读全文
posted @ 2023-09-01 09:22 cnblogs用户 阅读(1047) 评论(0) 推荐(0) 编辑
摘要: 数据准备 import pandas as pd product_info = { "订单号": [ "2951110000099262111", "2181910000909928191", "2194560000121355545", "1194560000121311126", "148316 阅读全文
posted @ 2023-08-07 09:43 cnblogs用户 阅读(69) 评论(0) 推荐(0) 编辑
摘要: # 数据准备 ```python import pandas as pd product_info = { "订单号": ["2951110000099262111", "2181910000909928191", "2194560000121355545", "119456000012131112 阅读全文
posted @ 2023-08-07 08:36 cnblogs用户 阅读(16) 评论(0) 推荐(0) 编辑
摘要: # 数据准备 ```python import pandas as pd product_info = { "产品": ["李子", "桃子", "香蕉", "饺子", "馒头", "包子", "猪肉", "牛肉"], "分类": ["水果", "水果", "水果", "生鲜", "生鲜", &qu 阅读全文
posted @ 2023-08-04 16:04 cnblogs用户 阅读(8) 评论(0) 推荐(0) 编辑
摘要: # 一、通过标签名设置`css`样式 使用`pd.to_html()`方法如果不指定文件路径,该函数会返回一个格式化的`html`字符串,我们可以对这个字符串进行自定义操作,比如直接用我们设置的`css`样式加上这个格式化的`html`,就可以实现自定义表格样式,如下: ```python data 阅读全文
posted @ 2023-07-25 16:58 cnblogs用户 阅读(491) 评论(0) 推荐(0) 编辑
摘要: fixed_columns = ['交收类别', '证券市场', '证券编号', '项目编号', '证券名称', '成交价格', '交收日期'] fixed_columns2 = ['交收类别', '证券市场', '证券编号', '证券名称', '交收日期'] fixed_df = pd.DataF 阅读全文
posted @ 2023-06-05 14:25 cnblogs用户 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 在Excel的cell中添加超链接,链接到当前文件的其他sheet页 方法一:openpyxl库 from openpyxl import load_workbook # 读取工作薄 workbook = load_workbook(fp) sheet1 = workbook['Sheet1'] # 阅读全文
posted @ 2023-05-24 15:57 cnblogs用户 阅读(476) 评论(0) 推荐(0) 编辑