随笔分类 -  python / python 日常积累

摘要:def binary_to_decimal(binary_str): return int(binary_str, 2) def octal_to_decimal(octal_str): return int(octal_str, 8) def decimal_to_decimal(decimal_ 阅读全文
posted @ 2024-09-29 14:14 jarico 阅读(4) 评论(0) 推荐(0) 编辑
摘要:python 使用 pyinstaller 打包 1、下载pyinstaller pip install pyinstaller 2、在当前目录下生成 .spec 文件 注意,这行命令在生成文件的时候,也打包了输出物 pyinstaller --name=pytasker main.py --one 阅读全文
posted @ 2024-09-29 11:40 jarico 阅读(114) 评论(0) 推荐(0) 编辑
摘要:读取文本十六进制,保存为图片 目录结构 D:\SFW\PY_TOOLS\PNGPY main.py mhex.txt output.png main.py def hex_to_png(hex_file, output_file): # 从文件中读取十六进制数据 with open(hex_file 阅读全文
posted @ 2024-09-26 18:49 jarico 阅读(64) 评论(0) 推荐(0) 编辑
摘要:在 Python 中,json.dumps() 函数会将 Python 对象序列化为 JSON 字符串,并默认使用 UTF-8 编码来处理非 ASCII 字符。虽然在 Python 3 中,字符串是默认以 Unicode 形式存储的,但是当 json.dumps() 将 Python 字符串转换为 阅读全文
posted @ 2024-09-09 11:09 jarico 阅读(430) 评论(0) 推荐(0) 编辑

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