随笔分类 - Python
摘要:var code = "69c58911-f211-47df-9a1e-5e8192157285" import numpy as np # 罗德里格矩阵模型,根据公共点计算旋转矩阵与平移矩阵 def RodriguesMatrixModel(src, dst): # 计算比例关系 scale =
阅读全文
摘要:# 获取文件编码类型 import chardet import os # 获取文件编码 def get_encoding(file_path): with open(file_path, 'rb') as f: return chardet.detect(f.read())['encoding']
阅读全文
摘要:尝试zip压缩包密码 实测在五位时就很吃力了 import multiprocessing import zipfile import time import os # 字母数字表 table = [chr(i) for i in range(97, 123)] num = [chr(i) for
阅读全文
摘要:源码链接 个人博客地址 具体实现 import hashlib path = '' with open(path, 'rb') as f: print(hashlib.md5(f.read()).hexdigest())
阅读全文
摘要:源码链接 个人博客地址 具体实现 import math from concurrent.futures import ProcessPoolExecutor import requests # 设置超时时间为30s # socket.setdefaulttimeout(30) # 默认每个片最小2
阅读全文
摘要:源码链接:https://github.com/WindSnowLi/My-python-tools/tree/main/CheckID 个人博客地址:https://www.blog.hiyj.cn/article/detail/115 区号列表 {"110000":"北京市","110101":
阅读全文
摘要:一、废话少说,先上效果 二、坑说在前边 电脑设备名不能是中文,不然smtplib连接邮箱服务器时会报域名编码错误,错误提示如下: hostname, aliases, ipaddrs = gethostbyaddr(name) UnicodeDecodeError: 'utf-8' codec ca
阅读全文
摘要:原文:https://www.blog.hiyj.cn/article/detail/110 简笔画图片转字符串 效果 结果 源码示例:https://github.com/WindSnowLi/My-python-tools/tree/main/Img->Str # encoding:utf-8
阅读全文
摘要:原文:https://www.blog.hiyj.cn/article/detail/102 代码地址ResizeImg 使用opencv-python的resize函数Linux使用pip3 install opencv-python、Windows使用pip install opencv-pyt
阅读全文
摘要:原文:https://www.blog.hiyj.cn/article/detail/107 有时会遇到将图片修改为ico格式,但是轻量级的工具不好找,在这里借用pillow库达到了这个效果 # PIL : pip3/pip install pillow from PIL import Image
阅读全文
摘要:主要就是修改注册表 代码地址:https://github.com/WindSnowLi/My-python-tools/tree/main/Windows11Reg import win32api import win32con def useWin10(key): """ 使用Windows10
阅读全文
摘要:只写了0,1,2的 import datetime import math import numpy as np import os from PIL import Image def get_path(path_root, data): temp_dir = os.listdir(path_roo
阅读全文
摘要:个人小作业,虽说做的很差,也算是一个学习的转化;主要用于分类自己下载的壁纸 1 背景 学期末需要一个学习成果的展示,高难度的自己做不来,模型也跑不动(电脑有点渣),刚好自己也有图片分类的需求,最后决定做了这个,确实也算做了一个自己用得到的小程序 2 项目说明 2.1 项目需求 需要自动加载指定目录所
阅读全文
摘要:嫖来的百度云服务的做法:生成一个服务端推送、客户端订阅的话题,同时生成一个服务端订阅、客户端推送的话题;注意权限问题 示例代码 服务端 import json import time import paho.mqtt.client as mqtt from threading import Thre
阅读全文
摘要:一、数据集官网链接 本文章源码及数据集文件 二、数据集解析格式 1. train-labels-idx1-ubyte与t10k-labels-idx1-ubyte为图片二进制数据文件 头两个32bit数据不在标签范围,读取时需要舍去 2. train-labels-idx1-ubyte与t10k-i
阅读全文
摘要:源码链接 import zxing import sys reader = zxing.BarCodeReader() barcode = reader.decode("二维码图片路径") print(barcode.parsed) # https://blog.csdn.net/u01083574
阅读全文
摘要:源代码链接 源代码链接中配套有提权执行bat文件哦 import re import urllib.request import os from shutil import copyfile import datetime # 需要验证的开始标识 NEED_TEST_START = "# MY_MU
阅读全文
摘要:GitHub链接 https://github.com/WindSnowLi/My-python-tools/tree/main/PythonGetCookie # -*- coding: UTF-8 -*- from http import cookiejar from urllib import
阅读全文
摘要:GitHub链接 https://github.com/WindSnowLi/My-python-tools/tree/main/DownloadM3u8 原文:https://www.blog.hiyj.cn/article/detail/75 下载部分 # -*- coding: UTF-8 -
阅读全文
摘要:python鼠标模拟操作 通过简单的记录鼠标坐标,并通过计算鼠标下图片的偏移来完成简单的位置校准,用于在微偏移的界面模拟鼠标操作 GitHub链接 https://github.com/WindSnowLi/My-python-tools/tree/main/PseudoOperation 原文:h
阅读全文