How to run different UIs from different files? #459
-
I had 2 Python files in my local drive G:/app folder - A.py & B.py I could run A.py without any problem. Is there any way to run different .py like it did in Flet? I couldn't figure that out after reading the fastapi and uvicorn's documentation. Many thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I think you need to use different ports. NiceGUI runs with port 8080 by default. If A is still running, B should complain about the port 8080 still being in use. But the browser opens nonetheless, showing A's UI. Just use something like |
Beta Was this translation helpful? Give feedback.
-
I'm not sure if this (see original link from stackoverflow below) is correct.
Let me try if it can enable 'running different nicegui_app.py files without needing to set the port other than 8080'. stackoverflow's post regarding 'killing port:8080': |
Beta Was this translation helpful? Give feedback.
I think you need to use different ports. NiceGUI runs with port 8080 by default. If A is still running, B should complain about the port 8080 still being in use. But the browser opens nonetheless, showing A's UI.
Just use something like
ui.run(port=8081)
in B and both UIs should work independently of each other.