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
- Author - Tsiresy Mila
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)
| File | Size | Uploaded | |
|---|---|---|---|
| pywui-0.1.7.tar.gz | 249.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|