GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - oyxdsg/Deepseek-pet: A cute desktop pet built with Python & PySide6

BranchesTags
Open more actions menu

Latest commit

 

History

2 Commits
2 Commits

Folders and files

NameName
Last commit message
Last commit date
assets
assets
 
 
docs
docs
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
config.py
config.py
 
 
main.py
main.py
 
 
pet_window.py
pet_window.py
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

桌面宠物 · Desktop Pet

桌面宠物预览

一个用 Python + PySide6 制作的桌面宠物。宠物会待机、巡逻走动、对点击做出反应,还能表演一套连贯动作。支持自定义亮度 / 对比度 / 饱和度。

English: A cute desktop pet built with Python & PySide6. It idles, wanders around, reacts to clicks, and can perform a sequence of animations. Brightness / contrast / saturation are user-adjustable.

✨ 功能特性

  • 🐾 待机动画:宠物坐在地上,随机待机
  • 🚶 随机巡逻:每隔一段时间随机在桌面上左右走动(自动切换朝向)
  • 🖱️ 交互反应:单击触发随机动作(正面 / 坐下 / 生气 / 背过身去)
  • 🤸 动作序列:右键菜单「表演一套动作」,连贯完成 正面 → 坐下 → 坐地上生气 → 起身 → 正面
  • 🔄 姿势过渡:坐姿与站姿之间切换会自动插入「坐下 / 起身」过渡动画
  • 🎨 画面调节:右键「设置」实时调整亮度 / 对比度 / 饱和度(自动保存)
  • 🧲 鼠标拖动:可抓住宠物在桌面任意拖动
  • 📐 智能对齐:素材自动裁剪透明边、统一缩放与脚部对齐,动作切换不跳变

🖥️ 环境要求

  • Python 3.8+
  • Windows / Linux / macOS(Qt 跨平台)

🚀 快速开始

# 1. 安装依赖
pip install -r requirements.txt

# 2. 运行
python main.py

依赖:PySide6、numpy。

🕹️ 操作方式

操作 效果
单击 触发随机动作反应
按住拖动 抓住宠物移动
右键 打开菜单(坐下 / 起身 / 生气 / 背过身去 / 表演一套动作 / 待机 / 设置 / 躲猫猫 / 退出)

🧩 自定义素材

宠物动画帧放在 assets/ 目录,每个子文件夹对应一个动作:

动作键 文件夹
idle 坐地上生气
front 正面
back 背面
side 侧面
sit 坐下
angry 坐地上生气
rise 起身

帧为透明背景 PNG,命名 frame_0000.png、frame_0001.png 等。程序会自动:

  • 裁剪透明边距
  • 统一缩放比例(保持各动作真实相对大小)
  • 脚部贴底对齐,消除画面跳动

在 config.py 中可调整显示尺寸、帧率、巡逻参数等。

📦 打包成可执行文件

使用 PyInstaller 打包为免安装版本:

pip install pyinstaller
pyinstaller --noconfirm --clean --windowed --name 桌面宠物 --add-data "assets;assets" main.py

打包结果在 dist/桌面宠物/,整个文件夹可直接分发运行(无需安装 Python)。

📄 许可证

本项目基于 MIT License 开源。

🙏 致谢

  • PySide6:Qt for Python
  • PyInstaller:打包工具

About

A cute desktop pet built with Python & PySide6

Topics

desktop-pet

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.