随笔分类 -  Python

1 2 3 4 5 ··· 7 下一页
脚本编程语言
摘要:图片转base64 def IconToBase64(self, UIPhoto): with open(UIPhoto, 'rb') as image_file: base64_string = base64.b64encode(image_file.read()).decode('utf-8') 阅读全文
posted @ 2026-02-09 10:58 Phoenixy 阅读(1) 评论(0) 推荐(0)
摘要:import os import zipfile import xml.etree.ElementTree as ET from openpyxl import load_workbook from PIL import Image import shutil def extract_excel_i 阅读全文
posted @ 2026-02-02 11:10 Phoenixy 阅读(5) 评论(0) 推荐(0)
摘要:获取yaml文件内容存储为Execl import yaml import pandas as pd def yaml_to_excel(yaml_file, excel_file): # 读取YAML文件 with open(yaml_file, 'r', encoding='utf-8') as 阅读全文
posted @ 2026-01-20 13:14 Phoenixy 阅读(6) 评论(0) 推荐(0)
摘要:import os from openpyxl import Workbook from openpyxl.drawing.image import Image from openpyxl.utils import get_column_letter def insert_images_to_exc 阅读全文
posted @ 2025-12-16 10:35 Phoenixy 阅读(34) 评论(0) 推荐(0)
摘要:import os from PIL import Image import sys def convert_folder_to_ico(input_folder, output_folder=None, sizes=None): """ 批量转换文件夹内的图片为ICO Args: input_fo 阅读全文
posted @ 2025-12-14 11:25 Phoenixy 阅读(12) 评论(0) 推荐(0)
摘要:创建setUp.py from cx_Freeze import setup, Executable setup( name = "AppName", version = "0.1", description = "Your application description", executables 阅读全文
posted @ 2025-09-19 16:12 Phoenixy 阅读(22) 评论(0) 推荐(0)
摘要:将三方库安装到自己的项目下 阅读全文
posted @ 2024-07-31 11:51 Phoenixy 阅读(51) 评论(0) 推荐(0)
摘要:基础 阅读全文
posted @ 2023-11-15 13:31 Phoenixy 阅读(127) 评论(0) 推荐(0)
摘要:虚拟环境的安装及使用 阅读全文
posted @ 2023-10-26 10:35 Phoenixy 阅读(119) 评论(0) 推荐(0)
摘要:现代、快速(高性能)的 Web 框架,用于构建基于 Python 的 API;基于 Starlette 和 Pydantic 库构建而成 官网:https://fastapi.tiangolo.com/ 1、安装 # 对于生产环境,还需要一个ASGI服务器,如Uvicorn或Hypercorn # 阅读全文
posted @ 2023-10-12 17:28 Phoenixy 阅读(435) 评论(0) 推荐(0)
摘要:定义 递归是一种解决问题的有效方法,在递归过程中,函数将自身作为子例程调用。 思想 函数调用函数本身,直到不能调用为止 注意事项 基本情况用于保证程序调用及时返回,不在继续递归,保证了程序可终止。 递推关系,可将所有其他情况拆分到基本案例。 ​递推关系​: 一个问题的结果与其子问题的结果之间的关系。 阅读全文
posted @ 2023-09-22 16:12 Phoenixy 阅读(96) 评论(0) 推荐(0)
摘要:特殊符号处理 # coding:utf-8 import os class make_folder: @staticmethod def __special_symbol_processing(folder_name): """目录名称中的特殊符号处理""" char_list = ['*', '| 阅读全文
posted @ 2023-08-31 17:33 Phoenixy 阅读(324) 评论(0) 推荐(0)
摘要:字符串、datetime、date 日期格式转换 阅读全文
posted @ 2023-08-09 10:56 Phoenixy 阅读(210) 评论(0) 推荐(0)
摘要:numpy 阅读全文
posted @ 2023-08-04 14:28 Phoenixy 阅读(161) 评论(0) 推荐(0)
摘要:calendar 日历模块 阅读全文
posted @ 2023-08-01 10:32 Phoenixy 阅读(143) 评论(0) 推荐(0)
摘要:方法一:绝对值 if __name__ == "__main__": """run""" print("负数取反-绝对值:{}".format(abs(-28))) print("正数数取反-绝对值:{}".format(abs(32) * -1)) 结果: 方法二:numpy库 # coding: 阅读全文
posted @ 2023-07-28 10:19 Phoenixy 阅读(2243) 评论(0) 推荐(0)
摘要:查询当前日期的所在月的天数 # coding:utf-8 import datetime import calendar from loguru import logger as logs class ca: @staticmethod def days_of_the_month(): """查询当 阅读全文
posted @ 2023-07-18 14:13 Phoenixy 阅读(499) 评论(0) 推荐(0)
摘要:auto-py-to-exe 图形化程序打包 安装 pip install auto-py-to-exe 执行 # 命令行输入 auto-py-to-exe 图形界面 < 选择好python文件之后点击convert .py to .exe 就可以进行打包了> 阅读全文
posted @ 2023-06-01 15:17 Phoenixy 阅读(190) 评论(0) 推荐(0)
摘要:python 操作redis数据库 阅读全文
posted @ 2023-06-01 11:04 Phoenixy 阅读(263) 评论(0) 推荐(0)
摘要:HMAC算法可以用于验证信息的完整性,这些信息可能在应用之间或者网络间传递 1、SHA加密 # -*- coding:utf-8 -*- import hmac import hashlib class hmac_tools: def __init__(self): self.key = "a123 阅读全文
posted @ 2023-05-26 14:25 Phoenixy 阅读(140) 评论(0) 推荐(0)

1 2 3 4 5 ··· 7 下一页