DEV Community

programmingGreen
programmingGreen

Posted on

HTML like simplicity in python GUIs is here!

Hey Python devs! 👋

I’m excited to share PyUIkit 1.0.0, a library that brings HTML-like simplicity to Python GUIs. With PyUIkit, you can create interactive desktop apps quickly using Div-based layouts and reusable components—no messy layout code required.


Example: Create a Window

from pyuikit import Body

app = Body(width=400, height=300, bg_color='white')
app.run()
Enter fullscreen mode Exit fullscreen mode

This creates a blank window with the size and background color you choose.

window


Example: Add Components

from pyuikit import Body, Div
from pyuikit.components import Text, Button, Input

def greet():
    name = Input.get_input(id='name_input')
    Text.set_text(id='greeting', new_text=f'Hello, {name}!')

app = Body(width=400, height=300, bg_color='white')

Div(
    width=360,
    height=250,
    children=[
        Text(text='Enter your name:'),
        Input(placeholder='Name',id='name_input'),
        Button(text='Greet',on_click=greet),
        Text(text='', id='greeting')
    ]
)

app.run()
Enter fullscreen mode Exit fullscreen mode

window

This shows how easy it is to create a GUI and add components—all in Python, with HTML-style simplicity.


Installation

pip install pyuikit
Enter fullscreen mode Exit fullscreen mode

Get started:

I’m open to PRs, feedback, and feature requests—issues can be reported on GitHub.

Would love to hear what you think! 🙂

Top comments (0)