Forráskód Böngészése

Merge branch 'main' of github.com:zauberzeug/nicegui into main

Falko Schindler 4 éve
szülő
commit
86cd2ddb43
4 módosított fájl, 37 hozzáadás és 5 törlés
  1. 1 1
      Dockerfile
  2. 3 2
      README.md
  3. 2 2
      main.py
  4. 31 0
      nicegui.code-workspace

+ 1 - 1
Dockerfile

@@ -13,4 +13,4 @@ WORKDIR /app
 COPY ./pyproject.toml ./poetry.lock* main.py ./
 COPY ./pyproject.toml ./poetry.lock* main.py ./
 RUN poetry install --no-root
 RUN poetry install --no-root
 
 
-CMD ./main.py
+CMD python3 -m debugpy --listen 5678 main.py

+ 3 - 2
README.md

@@ -1,6 +1,6 @@
 # NiceGUI
 # NiceGUI
 
 
-<img src="sceenshots/ui-elements.png?raw=true" width="300" align="right">
+<img src="https://github.com/zauberzeug/nicegui/tree/main/sceenshots/ui-elements.png?raw=true" width="300" align="right">
 
 
 We like [Streamlit](https://streamlit.io/) 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](https://justpy.io/). While too "low-level-html" for our daily usage it provides a great basis for our shot at a "NiceGUI".
 We like [Streamlit](https://streamlit.io/) 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](https://justpy.io/). While too "low-level-html" for our daily usage it provides a great basis for our shot at a "NiceGUI".
 
 
@@ -11,6 +11,7 @@ We like [Streamlit](https://streamlit.io/) but find it does to much magic when i
 - clean set of GUI elements (label, button, checkbox, switch, slider, input, ...)
 - clean set of GUI elements (label, button, checkbox, switch, slider, input, ...)
 - simple grouping with rows, columns and cards
 - simple grouping with rows, columns and cards
 - built-in timer to refresh data in intervals (even every 10 ms)
 - built-in timer to refresh data in intervals (even every 10 ms)
+- straight-forward data bindings to write even less code
 
 
 ## Usage
 ## Usage
 
 
@@ -37,7 +38,7 @@ See [main.py](/main.py) for an example of all API calls you can make with NiceGU
 
 
 ## Plots
 ## Plots
 
 
-<img src="sceenshots/live-plot.gif?raw=true" width="400" align="right">
+<img src="https://github.com/zauberzeug/nicegui/tree/main/sceenshots/live-plot.gif?raw=true" width="400" align="right">
 
 
 ```python
 ```python
 lines = ui.line_plot(n=2, limit=20).with_legend(['sin', 'cos'], loc='upper center', ncol=2)
 lines = ui.line_plot(n=2, limit=20).with_legend(['sin', 'cos'], loc='upper center', ncol=2)

+ 2 - 2
main.py

@@ -19,7 +19,7 @@ with ui.row():
             with ui.column():
             with ui.column():
                 with ui.row():
                 with ui.row():
                     ui.radio(options=['A', 'B', 'C'], value='A', on_change=lambda e: output.set_text(e.value))
                     ui.radio(options=['A', 'B', 'C'], value='A', on_change=lambda e: output.set_text(e.value))
-                    ui.radio(options={1: 'A', 2: 'B', 3: 'C'}, value=1, on_change=lambda e: output.set_text(e.value))
+                    ui.radio(options={1: 'o', 2: 'oo', 3: 'ooo'}, value=1, on_change=lambda e: output.set_text(e.value))
                 with ui.row():
                 with ui.row():
                     ui.select(options=['a', 'b', 'c'], value='a', on_change=lambda e: output.set_text(e.value))
                     ui.select(options=['a', 'b', 'c'], value='a', on_change=lambda e: output.set_text(e.value))
                     ui.select(options={1: 'a', 2: 'b', 3: 'c'}, value=1, on_change=lambda e: output.set_text(e.value))
                     ui.select(options={1: 'a', 2: 'b', 3: 'c'}, value=1, on_change=lambda e: output.set_text(e.value))
@@ -27,7 +27,7 @@ with ui.row():
                 ui.toggle({1: 'X', 2: 'Y', 3: 'Z'}, value=1, on_change=lambda e: output.set_text(e.value))
                 ui.toggle({1: 'X', 2: 'Y', 3: 'Z'}, value=1, on_change=lambda e: output.set_text(e.value))
         with ui.row():
         with ui.row():
             ui.label('Output:')
             ui.label('Output:')
-            output = ui.label()
+            output = ui.label(' ', 'bold')
 
 
     with ui.column():
     with ui.column():
         with ui.card():
         with ui.card():

+ 31 - 0
nicegui.code-workspace

@@ -0,0 +1,31 @@
+{
+  "folders": [
+    {
+      "path": "."
+    }
+  ],
+  "settings": {},
+  "extensions": {
+    "recommendations": [
+      "ms-python.vscode-pylance",
+      "ms-python.python",
+      "himanoa.python-autopep8",
+      "esbenp.prettier-vscode",
+      "littlefoxteam.vscode-python-test-adapter"
+    ]
+  },
+  "launch": {
+    "version": "0.2.0",
+    "configurations": [
+      {
+        "name": "Dockerized NiceGUI",
+        "type": "python",
+        "request": "attach",
+
+        "connect": {
+          "port": 5678
+        }
+      }
+    ]
+  }
+}