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-cli 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-cli 0.1.7
File Size Uploaded
pywui_cli-0.1.7.tar.gz 1.6 MB Details

Built distribution (wheel)

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

Total release size: 3.2 MB

Release files / pywui_cli-0.1.7.tar.gz

Download URL pywui_cli-0.1.7.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
606a1f871648b3ff6833d6f615b4751fe005374515690741d344d7dde706c32a
BLAKE2b-256 checksum
How to use checksums
f7529307735337b550908d364d2745d04e80c9814e47b7209ead1198667f668f
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_cli-0.1.7-py3-none-any.whl

Download URL pywui_cli-0.1.7-py3-none-any.whl
Size 1.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
3966956f4c628e253fc40f2b69c8698808e4fb21be65d1155670ed933230789e
BLAKE2b-256 checksum
How to use checksums
1bba82b603c0bc933e1ab3eabba143f2922580dbce017e43258ab40182ae2c50
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