python的GUI工具dearpygui入门指南
2023-09-11 14:17:10 时间
一 概念
1.dearpygui
它是一个易于使用的、动态的、GPU加速的、跨平台的、适用于Python的图形用户界面工具包(GUI)。
2.特性
-
GPU 渲染
-
简单的内置异步功能支持
-
完整的主题和样式控制
-
简单的内置日志窗口
-
70多个小部件具有数百种小部件组合
-
详细的文档,示例和无与伦比的支持
3.它是谁的菜?
想用python做界面数据显示的话,想要快速上手,它一个很好的选择。
二 安装方式
1.pip安装
# 的 $ pip install dearpygui
三 实例解析
1.基本IO实现
import dearpygui.dearpygui as dpg dpg.create_context() def change_text(sender, app_data): dpg.set_value("text item", f"Mouse Button ID: {app_data}") def visible_call(sender, app_data): print("I'm visible") with dpg.item_handler_registry(tag="widget handler") as handler: dpg.add_item_clicked_handler(callback=change_text) dpg.add_item_visible_handler(callback=visible_call) with dpg.window(width=500, height=300): dpg.add_text("Click me with any mouse button", tag="text item") dpg.add_text("Close window with arrow to change visible state printing to console", tag="text item 2") # bind item handler registry to item dpg.bind_item_handler_registry("text item", "widget handler") dpg.bind_item_handler_registry("text item 2", "widget handler") dpg.create_viewport(title='Custom Title', width=800, height=600) dpg.setup_dearpygui() dpg.show_viewport() dpg.start_dearpygui() dpg.destroy_context()
三 参考
1.中文教程链接:
https://www.osgeo.cn/dearpygui/tutorials/first-steps.html
2.英文教程链接:
https://dearpygui.readthedocs.io/en/latest/documentation/plots.html
相关文章
- Python脚本扫描给定网段的MAC地址表(scapy或 python-nmap)
- python语法基础_01.Python基础
- MongoDB之python简单交互(三)
- Python任意参数的数量/预习课python基础
- 《python 与数据挖掘 》一1.3 Python开发环境的搭建
- 【python】+'chromedriver' executable needs to be in PATH
- python模块之lib2to3(py2转py3自动化工具)
- 《树莓派Python编程入门与实战(第2版)》——3.3 安装Python和工具
- 《树莓派Python编程入门与实战(第2版)》——3.8 使用适当的工具
- 《Python和Pygame游戏开发指南》——2.12 pygame.Color对象
- Python实例 包机制
- 「基于Python技术的智慧中医商业项目」Django后端用户应用设计
- Python NVIDIA Isaac机器人平台开发教程之 边缘 AI 的最佳工具是什么?Jetson Nano是什么
- Python 数据分析教程之如何验证线性回归的假设,线性回归的假设是什么?以及如何用python验证它们?
- 数字设计工程师必须学习工具语言,怎么什么行业都有Python?
- python之tkinter使用-复选框操作
- 华为OD机试 - 寻找密码(Python)
- Python 工具之 jupyter notebook 的打开 、默认工程项目配置路径的修改为指定路径
- Unity 工具 之 报错 Jenkins 执行/调用 Python 脚本,报错提示 ‘python‘ 不是内部或外部命令,也不是可运行的程序或批处理文件
- 学习笔记(12):Python网络编程&并发编程-解决粘包问题-简单版本
- 整理了一下Python中时间的格式化、date(时间)和str(文本)之间的相互转换、以及相关的时间转换方法
- 【python】报错:SyntaxError: Non-UTF-8 code starting with ‘xd0‘ in file 随手记
- [Python]python+yaml三行代码完成配置文件灵活读取与warning:YAMLLoadWarning处理
- Python pyinstaller 打包 exe