#
Python
本地环境使用ollama千问大模型
安装ollama和千问 [ollama官网](https://ollama.com/library/qwen) 通过api调用 python import requests import json url = "http://localhost:11434/api/chat" payload = { "model": "qw...
Posted by spike on 2024-04-06
#
Python
Python nuitka 不同平台统一打包脚本
python import os import platform app_name ='douyin_auto' ico_path ='' output ='output' main ='main.py' system =platform.system) version =platform.release() if system='Windows': ...
Posted by spike on 2024-03-01
#
Python
Python ImageGrab 图像对比 监控屏幕变化
python from PIL import ImageGrab import numpy as np import time import requests Import the requests library def get_screen_region_screenshot(region): """ 获取屏幕指定区域的截图 ...
Posted by spike on 2024-02-15
#
Python
Python fastapi的缓存插件 fastapi-cache2
安装 bash pip install fastapi-cache2 or pip install "fastapi-cache2[redis]" or pip install "fastapi-cache2[memcache]" or pip install "fastapi-cache2[dynamodb]" 使用例子 ...
Posted by spike on 2024-02-15
#
Python
Python mosaic 算法 2
python """ mosaic.py A simple python script that creates a mosaic from an input image. Dependencies: Python Imaging Library, available at http://www.pythonware.com/products/pil/ Summ...
Posted by spike on 2024-02-07
#
Python
Python potrace 位图转矢量图
简介 使用potrace.exe可以把位图转化为svg然后上传到阿里云oss存储。 为什么要使用阿里云的oss存储呢? 因为需要转换的量实在太大了,超过200w张文件,磁盘的存储这么多文件在执行过程中会逐渐卡死,即使时使用的是ssd,故使用阿里云的oss,这样可以缓解磁盘性能引起的程序中断问题。 代码 python import sys im...
Posted by spike on 2024-02-06
#
Python
Python mosaic 算法
python from PIL import Image import os import random 定义瓦片图的尺寸 TILE_SIZE = 32 获取目录下的所有瓦片图 def get_tiles(path): tiles = [] for file in os.listdir(path): file_pat...
Posted by spike on 2024-02-06
#
Python
Python fontforge 字库ttf导出png图片
python import fontforge F = fontforge.open("perpetua.ttf") for name in F: filename = name + ".png" print name F[name].export(filename) F[name].export(filename, 600) set height to 6...
Posted by spike on 2024-01-30
#
Python
安全 反编译工具 DAILA
网址 [DAILA](https://github.com/mahaloz/DAILA) 简介 * 多反编译器支持:DAILA集成了LibBS库,所以它支持所有LibBS支持的反编译器,包括IDA, Ghidra, Binja和angr-management。 * 多AI系统接入:目前,DAILA支持OpenAI和VarBERT(一种本地模型,专门用于反编译中的变...