GuiZero ساخت آسان محیط گرافیکی

Guizero یک کتابخانه ساخته شده بر مبنای tkinter برای ساخت آسان محیط گرافیکی با پایتون 3 است

طریقه نصب از طریق pip

Pip install guizero
  • ساخت اولین پروژه hello world
from guizero import App, Text
app = App(title="Hello world")
message = Text(app, text="Welcome to the Hello world app!")
app.display()

hello-world

  • قالب بندی grid
from guizero import App, PushButton
def do_nothing():
    print("Nothing happened")

app = App(title="Keypad example", width=100, height=90, layout="grid")
button1 = PushButton(app, command=do_nothing, text="1", grid=[0,0])
button2 = PushButton(app, command=do_nothing, text="2", grid=[1,0])
button3  = PushButton(app, command=do_nothing, text="3", grid=[2,0])
button4  = PushButton(app, command=do_nothing, text="4", grid=[0,1])
button5  = PushButton(app, command=do_nothing, text="5", grid=[1,1])
button6  = PushButton(app, command=do_nothing, text="6", grid=[2,1])
app.display()

keypad_windows

  • پنجره هشدار
from guizero import App, warn
app = App(title="Biscuit monitor")
warn("Uh oh!", "You are almost out of biscuits!")
app.display()

warning_windows

مستندات کامل :slight_smile:

https://lawsie.github.io/guizero/about/

4 پسندیده