|
4 vuotta sitten | |
---|---|---|
.github | 4 vuotta sitten | |
.vscode | 4 vuotta sitten | |
nicegui | 4 vuotta sitten | |
sceenshots | 4 vuotta sitten | |
.gitignore | 4 vuotta sitten | |
LICENSE | 4 vuotta sitten | |
README.md | 4 vuotta sitten | |
custom_test.py | 4 vuotta sitten | |
development.dockerfile | 4 vuotta sitten | |
docker-compose.yml | 4 vuotta sitten | |
docker.sh | 4 vuotta sitten | |
examples.py | 4 vuotta sitten | |
main.py | 4 vuotta sitten | |
nicegui.code-workspace | 4 vuotta sitten | |
poetry.lock | 4 vuotta sitten | |
pyproject.toml | 4 vuotta sitten | |
release.dockerfile | 4 vuotta sitten |
We like Streamlit but find it does too much magic when it comes to state handling. In search for an alernative nice library to write simple graphical user interfaces in Python we discovered justpy. While too "low-level HTML" for our daily usage it provides a great basis for "NiceGUI".
NiceGUI is intended to be used for small scripts and single-page user interfaces with a very limited user base. Like smart home solutions, micro web apps or robotics projects. It's also helpful for development, when tweaking/configuring a machine learning training or tuning motor controllers.
python3 -m pip install nicegui
Write your nice GUI in a file main.py
:
from nicegui import ui
ui.label('Hello NiceGUI!')
ui.button('BUTTON', on_click=lambda: print('button was pressed', flush=True))
Launch it with:
python3 main.py
The GUI is now avaliable through http://localhost/ in your browser. Note: The script will automatically reload the page when you modify the code.
Use the multi-arch docker image for pain-free installation:
docker run --rm -p 8888:80 -v $(pwd)/my_script.py:/app/main.py -it zauberzeug/nicegui:latest
This will start the server at http://localhost:8888 with code from my_script.py
within the current directory.
Code modification triggers an automatic reload.
The API reference is hosted at https://nicegui.io and is implemented with NiceGUI itself. You should also have a look at examples.py for an extensive demonstration of what you can do with NiceGUI.