eui
eui means easy UI. It is a fast and simple micro-framework for small browser-based applications. Python and JS communicate through websocket protocol.
install
pip install eui
example
Step 1:
create python file, main.py:
import webbrowser
import eui
def say_hello(message):
print('receive message from js:', message)
eui.js('''
(msg) => {
alert('receive message from py: ' + msg)
}
''', message)
def startup_callback():
webbrowser.open(f'http://localhost:{eui.get_port()}/static/index.html')
handlers = {
'say_hello': say_hello,
'exit': eui.exit
}
eui.start(handlers=handlers, callback=startup_callback)
Step 2:
create UI file index.html in static folder:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>eui test</title>
<script src="eui.js"></script>
<script type="text/javascript">
function sendMessage() {
var message = document.getElementById('message').value;
eui.py('say_hello', message);
}
</script>
</head>
<body>
<input id="message">
<button onclick="sendMessage()">Send</button>
</body>
</html>
Step 3:
run main.py
snapshot:
Metadata
Release files for eui 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| eui-1.1.2.tar.gz | 6.3 kB | Without provenance | Details for eui-1.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| eui-1.1.2-py3.8.egg | Legacy Egg format | - | - | Details for eui-1.1.2-py3.8.egg |
Total release size: 19.3 kB
Release files / eui-1.1.2.tar.gz
| Download URL | eui-1.1.2.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dedf01ee3c0c88ca9c714df91c7feffea0e2961b6aa90603d337445e95c740f6
|
|
BLAKE2b-256 checksum How to use checksums |
a8715f8b2679f75e02f0353a839bcef8dd0e89a1769a68df864d240a4e60ff22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.10.0 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.2
|
Release files / eui-1.1.2-py3.8.egg
| Download URL | eui-1.1.2-py3.8.egg |
|---|---|
| Size | 13.0 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
00395f54eea943e26472f08c60a8c61238c07a5d2ff6a022b26d16f61570efb1
|
|
BLAKE2b-256 checksum How to use checksums |
9650e9c05692524f052704d853a9e9b652b6282349c5a1ec88d5247c22e68b09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.10.0 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.2
|
Security for eui 1.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.