Skip to main content

Pywui CLI for starting pywui project.

Project description

Version Python License

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

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.4.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

pywui_cli-0.1.4-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file pywui_cli-0.1.4.tar.gz.

File metadata

  • Download URL: pywui_cli-0.1.4.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

Hashes for pywui_cli-0.1.4.tar.gz
Algorithm Hash digest
SHA256 f9138e4d0997683993f4d913a362ccfcfa3e39dac0b2d2ababa31236fa1b580e
MD5 737eba73d699f0541ffeff84692f3c6c
BLAKE2b-256 f7e06e0ef4c7706b4e46981a0e72920050e0de6eb5263124b00d2648d149fb55

See more details on using hashes here.

File details

Details for the file pywui_cli-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: pywui_cli-0.1.4-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

Hashes for pywui_cli-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6adb4da17d28c0e5658442d79bb68280c37ce1225d271ae7b874ea030cdfac76
MD5 2f73eaf14c17ca72c1b59c5274761d11
BLAKE2b-256 5f8f85f93ad49b61fa335f1479caf0a0aa25b137ad40b43bdfd4b13d49cc8add

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page