摘要: Code: #!/usr/bin/env python import re # pip install httpx orjson loguru sanic gunicorn 'uvicorn[standard]' from httpx import AsyncClient from loguru i 阅读全文
posted @ 2025-08-20 18:03 waketzheng 阅读(5) 评论(0) 推荐(0)
摘要: Set mirror for pip mkdir ~/archives cd ~/archives git clone https://github.com/waketzheng/carstino cd carstino python pip_conf.py --pip Install pipx p 阅读全文
posted @ 2025-08-15 15:59 waketzheng 阅读(14) 评论(0) 推荐(0)
摘要: 问了DeepSeek,然后优化了一下: from typing import Any, Self from urllib.error import HTTPError, URLError from urllib.request import Request, urlopen try: import 阅读全文
posted @ 2025-08-10 20:12 waketzheng 阅读(16) 评论(0) 推荐(0)
摘要: cat gui.py from __future__ import annotations import sys import tkinter as tk class TkGui: @classmethod def input(cls, prompt: str = "", label_btn_tex 阅读全文
posted @ 2025-08-08 23:17 waketzheng 阅读(11) 评论(0) 推荐(0)
摘要: $ cat main.py from __future__ import annotations import re from pathlib import Path import typer __version__ = "0.1.2" cli = typer.Typer() @cli.comman 阅读全文
posted @ 2025-08-07 10:43 waketzheng 阅读(7) 评论(0) 推荐(0)
摘要: This is a Makefile for fastapi backend: help: @echo "Mech3D development makefile" @echo @echo "Usage: make <target>" @echo "Targets:" @echo " up Updat 阅读全文
posted @ 2025-08-04 22:59 waketzheng 阅读(8) 评论(0) 推荐(0)
摘要: This is a python script that start a frontend server and auto open browser (requires Python3.8+): #!/usr/bin/env python3 """前端服务启动脚本(会自动打开浏览器) Usage:: 阅读全文
posted @ 2025-08-04 22:24 waketzheng 阅读(5) 评论(0) 推荐(0)
摘要: I can be as simple as: app = FastAPI(default_response_class=ORJSONResponse) Or more robust: from fastapi import FastAPI from fastapi.responses import 阅读全文
posted @ 2025-07-26 10:54 waketzheng 阅读(12) 评论(0) 推荐(0)
摘要: xGate限制了uv对网络的访问权限,所以Windows环境下,需要使用pip来安装依赖,但pdm创建虚拟环境时,是默认不带pip的,为了统一两个环境的命令,编写了这个脚本: #!/usr/bin/env python """ Install deps by `pdm install -G :all 阅读全文
posted @ 2025-07-20 15:08 waketzheng 阅读(8) 评论(0) 推荐(0)
摘要: requests import requests from requests.auth import HTTPDigestAuth host = 'https://192.168.0.2' path = '/api/xxx' path2 = '/another/api' AUTH = ('usern 阅读全文
posted @ 2025-06-17 16:18 waketzheng 阅读(16) 评论(0) 推荐(0)