Skip to main content

A simple way to make beautiful GUIs in Python using CSS

Project description

brow

A simple way to make beautiful GUIs in python, using CSS. which will make people raise their brow(s)


  • Write your GUI in Python instead of HTML.
  • Update GUI elements from Python too.
  • Style using CSS.

Install

pip install -r requirements.txt
playwright install firefox

Example

from brow import brow

app = brow(target_width=300)

app.lcss("""
    body { background: #0d1117; font-family: Arial, sans-serif; }
    .container { padding: 40px; text-align: center; }
    .count { font-size: 72px; font-weight: bold; color: #e6edf3; margin-bottom: 20px; }
    .btn { 
        display: inline-block; padding: 12px 40px;
        background: #238636; color: #ffffff;
        border-radius: 8px; font-size: 18px; cursor: pointer;
        margin: 6px;
    }
    .btn:hover { background: #2ea043; }
    .btn-red { background: #b62324; }
    .btn-red:hover { background: #da3633; }
""")

count = 0

container = app.add("div", class_="container")
label = container.add("div", str(count), class_="count")

def increment():
    global count
    count += 1
    label.text = str(count)
    app.render()

def decrement():
    global count
    count -= 1
    label.text = str(count)
    app.render()

container.add("div", "−", class_="btn btn-red").on_click(decrement)
container.add("div", "+", class_="btn").on_click(increment)

app.render()
app.start_loop()

How it works

brow simply converts your Python elements to HTML, and renders it using a headless Firefox browser, displaying it in a Tkinter window. Yeah its weird and messy but it works.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

browpy-0.0.1.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

browpy-0.0.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file browpy-0.0.1.tar.gz.

File metadata

  • Download URL: browpy-0.0.1.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for browpy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 eed5122299857cf108b8ea7a4df2609efc482d7c4ae29713e293f43f5b7bdd01
MD5 1bbf3f9e293312bc75dd3f443a6e301f
BLAKE2b-256 5ea493ed67594bcbee7f7145c3897e3a5a36608393d3d6bda9363dcae03c6933

See more details on using hashes here.

File details

Details for the file browpy-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: browpy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for browpy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d75ca4917af3dcee4ff5accf412b4a68d90118616dcdd603710123a88c4e76e2
MD5 5573dd2ac000bfec7efd0e079250cfc2
BLAKE2b-256 9f4624c95e3be6812c032872205c324dfc57e04d2bbef14688ca170d8d179de4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page