chriskiehl / Gooey

Turn (almost) any Python command line program into a full GUI application with one line
MIT License
20.69k stars 1.02k forks source link

I am very pleased to recommend a library for adding pop ups #914

Closed xike110 closed 5 months ago

xike110 commented 5 months ago

I am very pleased to recommend a library for adding pop ups, which can add some login windows and pop up pages

It's very simple, there's no need for learning costs

https://github.com/pyapp-kit/magicgui

type_map_0

from magicgui import magicgui
from magicgui.widgets import request_values
try:
    vals = request_values(
        age={"annotation": int, "label": "Age:"},
        name={"annotation": str, "label": "Enter your name:"},
        qidong={"annotation": bool, "label": "Start or not?"},
        title="Hi, who are you?",
    )
    # print(type(vals)) # 
    print(vals["age"])
    print(vals["name"])
except Exception as e:
    print(e)
    print("You rejected the input, the program ended!")