会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
guanchaoguo
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
3
4
5
6
7
8
9
10
11
···
68
下一页
2024年9月10日
pydantic 和 sqlalchemy 之间的模型转换
摘要: 字段dict # Assuming `session` is your SQLAlchemy session user_instance = session.query(User).first() # Convert to Pydantic model dapter = TypeAdapter(Us
阅读全文
posted @ 2024-09-10 15:35 vx_guanchaoguo0
阅读(544)
评论(0)
推荐(0)
2024年9月6日
python 协程运行在线程上
摘要: run_in_executor asyncio.create_task import asyncio from concurrent.futures import ThreadPoolExecutor def run(cron, *args): loop = asyncio.new_event_lo
阅读全文
posted @ 2024-09-06 18:01 vx_guanchaoguo0
阅读(14)
评论(0)
推荐(0)
python 命令行参数解析
摘要: 追加参数 python example.py NewYork LosAngeles Chicago 给参数申明 分配内存 Locations: ['NewYork', 'LosAngeles', 'Chicago'] 具体实现 import argparse parser = argparse.Ar
阅读全文
posted @ 2024-09-06 10:08 vx_guanchaoguo0
阅读(11)
评论(0)
推荐(0)
2024年9月5日
gitlab 推送代码
摘要: Git 全局设置: git config --global user.name "寂寞的钢蛋儿" git config --global user.email "guanchaoguo@qq.com" 创建 git 仓库: mkdir dicom-web cd dicom-web git init
阅读全文
posted @ 2024-09-05 18:15 vx_guanchaoguo0
阅读(11)
评论(0)
推荐(0)
git 查看分支的从哪里拉出来 或者 一次提交拉出新的分支
摘要: 查看分支的源头 git reflog show dev 拉出分的分支 (8d6f4f17 提交id) git checkout -b rimag 8d6f4f17
阅读全文
posted @ 2024-09-05 12:54 vx_guanchaoguo0
阅读(21)
评论(0)
推荐(0)
ubuntu preview 设置密码
摘要: 安装 sudo apt-get isntall postgresql 登录(无需密码) sudo -u postgres psql 修改密码 alter user postgres with password '123456'; 新密码登录 psql -U postgres -d postgres
阅读全文
posted @ 2024-09-05 11:29 vx_guanchaoguo0
阅读(11)
评论(0)
推荐(0)
djiango module 错误
摘要: 报错如下 实际设置 需要加上级包名 通过 apps.py 统一处理
阅读全文
posted @ 2024-09-05 10:57 vx_guanchaoguo0
阅读(6)
评论(0)
推荐(0)
2024年9月4日
ubuntu preview 服务管理
摘要: 查看全部运行的服务 systemctl list-units --type=service --state=running 关闭开机自启的服务 sudo systemctl disable orthanc.service sudo systemctl disable orthanc.service
阅读全文
posted @ 2024-09-04 16:25 vx_guanchaoguo0
阅读(11)
评论(0)
推荐(0)
python redis 分布式锁 自动超时
摘要: 失败条件 已存在获取失败 超时任务超时失败 代码 import redis_lock try: lock_key = "xxxx" with redis_lock.Lock(redis_client, lock_key, expire=10): # do something db_session.c
阅读全文
posted @ 2024-09-04 16:16 vx_guanchaoguo0
阅读(10)
评论(0)
推荐(0)
git 删除已经提交的额记录
摘要: 回退到需要删除的位置 git reset --hard 09ee2edf9fcef3d79391f98ce62b3428e120ce46 强制推送 git push origin rimag --force
阅读全文
posted @ 2024-09-04 16:02 vx_guanchaoguo0
阅读(17)
评论(0)
推荐(0)
上一页
1
···
3
4
5
6
7
8
9
10
11
···
68
下一页
公告