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-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)
| File | Size | Uploaded | |
|---|---|---|---|
| pywui_cli-0.1.7.tar.gz | 1.6 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|