Pywui CLI for starting pywui project.
Project description
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.
Project details
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.3.tar.gz
(1.6 MB
view details)
Built Distribution
File details
Details for the file pywui_cli-0.1.3.tar.gz
.
File metadata
- Download URL: pywui_cli-0.1.3.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 | 666f26e82b3a285b712f526c4d46400ae049205775bb8d4f3039840f6db673cf |
|
MD5 | ee34ee21b5d8e78de3083dc575e53d28 |
|
BLAKE2b-256 | 51ce3daff3dc3ed97d3a5199bce365c0e9071bc37384975add9c98267504fdd9 |
File details
Details for the file pywui_cli-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: pywui_cli-0.1.3-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 | 2db5efaafb1ad5fe7ebed2cde7cbb5e5ef94d6cdfaf5485c297bec783fa87583 |
|
MD5 | 1fa298152f9939a8ee5f90b178bfc975 |
|
BLAKE2b-256 | 91e6b689d23c24d2577743ce3e83c3a2837a7da077e985301cc3856a181e5396 |