一 概念
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
作者:虚生 出处:https://www.cnblogs.com/dylancao/ 以音频和传感器算法为核心的智能可穿戴产品解决方案提供商 ,提供可穿戴智能软硬件解决方案的设计,开发和咨询服务。 勾搭热线:邮箱:1173496664@qq.com weixin:18019245820 市场技术对接群:347609188 |