Fork me on GitHub

随笔 - 997  文章 - 5  评论 - 181  阅读 - 300万 
一 概念
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
 
posted on   虚生  阅读(1235)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
历史上的今天:
2020-05-07 蓝牙5.0协议及下载地址
2018-05-07 机器学习库--dlib
2018-05-07 ubuntu查看内存占用和查看cpu使用情况的简单方法(ubuntu内存管理)
点击右上角即可分享
微信分享提示