摘要: 主要分为3个步骤,解压docx文件,压缩图片,压缩文件,需要用到zipfile和pillow 1. 解压docx文件 import zipfile zip_file = zipfile.ZipFile("./test.docx") zip_file.extractall("./test") zip_ 阅读全文
posted @ 2023-12-19 21:19 wstong 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 1. word格式转换 先将word转换为xml格式,路径需要绝对路径 from win32com import client import os def doc2docx(path): word = client.Dispatch("Word.Application") doc = word.Do 阅读全文
posted @ 2023-12-04 12:08 wstong 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 1. requests_toolbelt 先安装requests_toolbelt pip install requests_toolbelt 上传实例 import requests from requests_toolbelt import MultipartEncoder upload_url 阅读全文
posted @ 2023-11-29 10:28 wstong 阅读(376) 评论(0) 推荐(0) 编辑
摘要: 将当前文件夹的文件根据创建时间进行整理 # 整理当前文件夹 import time import os import shutil # 将旧文件复制到新路径 def cutFile(fileName): if os.path.isdir(fileName) == True: return if fi 阅读全文
posted @ 2023-11-03 10:37 wstong 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 这里只做简单的纯6位数字的密码的破解 import PyPDF2 from tqdm import trange PDFfile = "test.pdf" pdf_obj = open(PDFfile, "rb") pdf_reader = PyPDF2.PdfReader(pdf_obj) for 阅读全文
posted @ 2023-11-02 08:13 wstong 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 1. 接收蓝牙日志 可以用手机拨号##5959##打开蓝牙调试 然后使用对应的手机app先使用对应的蓝牙产品 2. 蓝牙日志分析 将手机上的蓝牙日志文件(btsnoop_hci.log)拷贝到电脑上使用wireshark打开,主要是看发送和接收的数据,以下是某体重秤 3. 寻找设备 import a 阅读全文
posted @ 2023-10-16 16:13 wstong 阅读(1233) 评论(0) 推荐(0) 编辑
摘要: 简单使用 安装 pip3 install black 使用 black {source_file_or_directory} 跳过字符串格式化 black -S {source_file_or_directory} 阅读全文
posted @ 2023-10-09 09:33 wstong 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 如图要删除以下两个分区,如果右键的话只弹出帮助,可以使用windows自带的diskpart命令 运行后效果如下 使用 list disk 查看磁盘 使用 sel disk 2 选择磁盘2 使用 list partition 查看当前磁盘分区 假设要删除分区1,则需要先选中分区1后再执行删除操作,命 阅读全文
posted @ 2023-09-25 19:56 wstong 阅读(62) 评论(0) 推荐(0) 编辑
摘要: 最近在抓包时发现返回值为一个奇怪的字符串,都是由H4sIA开头,最后发现是gzip压缩后的字符串,例如: H4sIAAAAAAAACqtWKkotLs0pUbKqViouSSwpLVayMtBRKi3IyU9McUxJAcoCRfJKc3JAgimJJak++ekwgcy8ktSissSckMzcV 阅读全文
posted @ 2023-08-24 14:02 wstong 阅读(300) 评论(0) 推荐(0) 编辑
摘要: 通过md5校验文件,我们可以判断文件内容是否改变,用python实现代码如下 import hashlib # 1.txt为空文本 with open("1.txt", "rb") as f: data = f.read() md5Old = hashlib.md5(data).hexdigest( 阅读全文
posted @ 2023-08-23 21:25 wstong 阅读(240) 评论(0) 推荐(0) 编辑