Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
( You should consider GUY (when available)! )
If you have made a super python tool, and you want to add a GUI but without using qt/gtk/tk/wx/kivy/toga : you are in the right place ! Just re-use the local browser (chrome in app mode) as GUI, drived by wuy.
Basically, it's a python module which will act as a web server (http & websocket) and will open/manage a window for you ; providing a simple framework (js/py3 helpers).
It lets you create your GUI with yours web skills (html/js/css or any js frameworks/libs), and re-use the power of python on server side.
Technically, it's a python3 module, using asyncio and the marvellous aiohttp, and (if present) the uvloop, for the full speed ! The http server is here to serve static content (html, js, images ...). The websocket is here to simplify the communication (sync/async) between the window & the server. (rpc method to communicate from client to server, pubsub mechanism to communicate from server to clients, or from client to clients)
In app/window mode : it will manage (open/close) the window for you ; using the chrome app mode ; if the websocket brokes : window & server will shutdown (close the window ; the server will shutdown, close the server ; the window will shutdown). You (or your clients) will not see a difference with classical GUI !
In server mode : it will act as a classical web server ; and you can use as many clients/browsers as you want, from localhost or from anywhere else. Closing a socket ; just close the socket ;-). It can be hosted on the web, as long as the provider service use python3.
More on window/server differences
In all cases : it will be pretty easy to produce/freeze an executable (windows/linux/apple) (one file with all html/js embedded), using pyinstaller/windows. And share your super python tool to the world (wuy comes with its own freezer (a wuy app !))! And in the future : android !
Since 0.6; wuy provide a js method to proxify http requests, to avoid CORS troubles.
Since 0.9; wuy provide get/set methods on client/server side to store/retrieve key/value pairs in a json file on serverside.
It's, a little bit, the same thing as python eel.
TODOs:
This is the hello world of wuy
import wuy
class helloWorld(wuy.Window):
""" <button onclick="wuy.beep()">BEEP</button> """
size=(100,100)
def beep(self):
print("\a BEEP !!!")
helloWorld()
Download the zip from here
$ pip3 install aiohttp winreg
$ python3 -u an_app.py
(winreg is needed for windows only)
It's an app !
For a regular server example (many clients from anywhere on web)
$ python3 -u a_server.py
Install the lib :
$ pip3 install wuy winreg
(winreg is needed for windows only)
And follow the official tuto.
Don't forget to have a look at real examples too (real apps for real life)
A big real life app : See jBrout3 (in development), it's the rebirth of the good old py2/gtk app : jBrout2. It use vuejs/vuex for front, and the jbrout's lib to manage photos.
Use wuy.Window for app (which open/manage a chrome window app)
Use wuy.Server for classic http/ws servers
And client side (javascript), in all cases : use wuy.js
FAQs
A simple module for making HTML GUI applications with python3/asyncio
We found that wuy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.