Skip to main content

Version Python License

Description

Pywui is a Python package wrapper for pywebview to make easy the communication between python and JS and async support.

Getting started

    pip install pywui_cli

Create new project

    pywui new my_projet

Example

import asyncio
from datetime import datetime

from pywui import command, PyWuiApp, PyWuiWindow, listener, with_window


@with_window
@listener("message", )
async def on_message(window: PyWuiWindow, message: str):
    print("Message received: {}".format(message))


@with_window
@command()
async def greet(window: PyWuiWindow):
    # window.toggle_fullscreen()
    window.emit("message", "Hello from python")
    print("Hello :::", window)
    return "Hello World!"


async def on_start(window: PyWuiWindow):
    async def send_time():
        while True:
            window.emit("time", datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
            await asyncio.sleep(1)

    await asyncio.create_task(send_time())


app = PyWuiApp()
main_window = app.get_window("main")
app.run(func=on_start, args=[main_window], debug=True)

Stay in touch

License

PyWui is MIT licensed.

Metadata

Release files for pywui 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pywui 0.1.7
File Size Uploaded
pywui-0.1.7.tar.gz 249.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pywui 0.1.7
File Interpreter ABI Platform
pywui-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 499.2 kB

Release files / pywui-0.1.7.tar.gz

Download URL pywui-0.1.7.tar.gz
Size 249.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9f08a5404c6e02f589f76b1e486342658cdec5f7cb367a8e5b1055a8e73405fd
BLAKE2b-256 checksum
How to use checksums
22122b67f8a0a1917abe1205bf66d328627e9d542f08f8ccfd17a67c01ddf68d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.4 Darwin/23.4.0

Release files / pywui-0.1.7-py3-none-any.whl

Download URL pywui-0.1.7-py3-none-any.whl
Size 249.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07be9defadcfc6d0370a1e0be32826a061083e9e8d328464b9c1ef9592828078
BLAKE2b-256 checksum
How to use checksums
acf7e1a70059fcad0489c2db6045ce2d76c5f14d09c4e0cb34c0e699a4f4585c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.4 Darwin/23.4.0

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page