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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pywui_cli-0.1.7.tar.gz
(1.6 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pywui_cli-0.1.7.tar.gz.
File metadata
- Download URL: pywui_cli-0.1.7.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/1.8.3 CPython/3.12.4 Darwin/23.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
606a1f871648b3ff6833d6f615b4751fe005374515690741d344d7dde706c32a
|
|
| MD5 |
a728f9c325bc023a727a229d8cd3e187
|
|
| BLAKE2b-256 |
f7529307735337b550908d364d2745d04e80c9814e47b7209ead1198667f668f
|
File details
Details for the file pywui_cli-0.1.7-py3-none-any.whl.
File metadata
- Download URL: pywui_cli-0.1.7-py3-none-any.whl
- Upload date:
- Size: 1.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/1.8.3 CPython/3.12.4 Darwin/23.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3966956f4c628e253fc40f2b69c8698808e4fb21be65d1155670ed933230789e
|
|
| MD5 |
e57fe4d81d764af8cb37c6bf1d99d5ef
|
|
| BLAKE2b-256 |
1bba82b603c0bc933e1ab3eabba143f2922580dbce017e43258ab40182ae2c50
|