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.1.tar.gz
(1.6 MB
view details)
Built Distribution
File details
Details for the file pywui_cli-0.1.1.tar.gz
.
File metadata
- Download URL: pywui_cli-0.1.1.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 | 970cbb9cfeca72268a4f925158e92e385b67b14ab7ec882a0479bdbd83facc2a |
|
MD5 | 52faf221524cfe474f7396af01477018 |
|
BLAKE2b-256 | 11b12521963d0a73f79ed184e49836f3236dbcc63f6af779a35af3fcacef676c |
File details
Details for the file pywui_cli-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: pywui_cli-0.1.1-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 | 72e88860685664258168213a20e9424f5f98c5605624deecd9f60de05b368463 |
|
MD5 | 23cf8095351e5b4c4515e3a8de469be1 |
|
BLAKE2b-256 | 6cf0d20f3853e6d42a8baf18e6025f514dbee8f0c11ed0e556b24fcb3aeb509a |