Like python eel, but for py3, with asyncio
Project description
wuy
It's like python eel BUT :
- it's not as polished
- it uses python3 ONLY
- it uses asyncio, and the marvellous aiohttp
- it's server hosted friendly from scratch
- it uses pubsub mechanism to communicate from server to clients, or from client to clients
- it's not pyinstaller-friendly for now
- com errors are catch'able thru the promise
it's a proof of concept : WUY means Web User Ynterface ...
to test/run
Download the zip from here
$ pip3 install aiohttp
$ python3 -u simple.py
to use
Install the lib :
$ pip3 install wuy
create a python file "web.py", and copy/paste this:
import wuy
wuy.start(app=True)
Run it, like this :
python3 web.py
It will create a "web/index.html", the defaut front-end ;-)
Edit "web/index.html", like this :
<script src="wuy.js"></script>
<button onclick="wuy.myadd(42,13).then( alert )">test</button>
Edit "web.py", like this :
import wuy
@wuy.expose
def myadd(a,b):
return a+b
wuy.start(app=(640,480))
and rerun your script :
python3 web.py
and you can start to code
but the future is ... bright ;-)
See examples :
- an_app : same as simple.py but in the new fashion
- an_app2 : an input box
- an_app3 : an alert box with autodeclared js vars !
- an_app4 : using sync & async rpc call !
- a_server : a server, tchat service for multiple clients
with wuy.Window for app (which open/manage a chrome window app)
with wuy.Server for classic http/ws servers
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wuy-0.4.0.tar.gz
(6.8 kB
view hashes)
Built Distribution
wuy-0.4.0-py3-none-any.whl
(9.4 kB
view hashes)