Toga Python和操作系统原生的跨平台GUI

Toga简介

Toga,Python第三方库,是Python和操作系统原生的GUI工具包,可在macOS、Windows、Linux(GTK)、Android、iOS和单页web应用程序上使用。

Toga应用实例

import toga

def button_handler(widget):
    print("hello")

def build(app):
    box = toga.Box()

    button = toga.Button("Hello world", on_press=button_handler)
    button.style.padding = 50
    button.style.flex = 1
    box.add(button)

    return box

def main():
    return toga.App("First App", "org.beeware.helloworld", startup=build)

if __name__ == "__main__":
    main().main_loop()

Toga Github统计数据

BSD-3-Clause license

Github 3.9k stars

Toga安装命令

pip install toga

Python版本要求

Toga requires Python 3.8 or higher. Python 2 is not supported.

免责声明:内容编辑自网络,仅供参考,不保证正确性,不作任何决策依据!!以上数据皆截止于博文的写稿日期。


行业导航 / Python指南 :
























Copyright © 2022-2024 笨鸟工具 x1y1z1.com All Rights Reserved.