快速搭建web见面

Falko Schindler ca1d75ab95 improve styling of code examples пре 4 година
.github fc127dc4fe trying to make automated pypi releases with poetry пре 4 година
.vscode 852faab6b1 do not set blank lines пре 4 година
nicegui ca1d75ab95 improve styling of code examples пре 4 година
sceenshots 02e770f4c1 adding docs for some interactive elements пре 4 година
.gitignore 11844e40cc cleanup пре 4 година
LICENSE 0cb68ea25c Adding license пре 4 година
README.md 73ad711fee moving line_plot from readme to main.py пре 4 година
development.dockerfile c21d1a6d7b preparing for release dockerfile пре 4 година
docker-compose.yml c21d1a6d7b preparing for release dockerfile пре 4 година
docker.sh 627296fbd6 simplified docker.sh пре 4 година
examples.py 4c49010f39 allow activating and deactivating a timer пре 4 година
main.py 73ad711fee moving line_plot from readme to main.py пре 4 година
nicegui.code-workspace e11050e6f3 made dev container debuggable пре 4 година
poetry.lock 2d87b5c281 adding binding dependency пре 4 година
pyproject.toml 2d87b5c281 adding binding dependency пре 4 година

README.md

NiceGUI

We like Streamlit but find it does to 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".

Purpose

NiceGUI is intended to be used for small scripts and user interfaces with a very limited user base. Custom "Smart-Home Control" solutions or "Robotics" for example. It's also helpful for development like tweaking/configuring a machine learning training or tuning motor controllers.

Features

  • browser-based GUI
  • shared state between multiple browser windows
  • implicit reload on code change
  • clean set of GUI elements (label, button, checkbox, switch, slider, input, ...)
  • simple grouping with rows, columns and cards
  • genral-purpose html and markdown elements
  • built-in timer to refresh data in intervals (even every 10 ms)
  • straight-forward data bindings to write even less code

Install

python3 -m pip install nicegui

Usage

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'))

Launch it with:

python3 main.py

Note: The script will automatically reload the GUI if you modify your code.

API

API Reference is hosted at https://nicegui.io. Also have a look at examples.py for an extensive demonstration what you can do with NiceGUI.