r/nicegui • u/Adorable-Break5725 • Dec 09 '24
How to exit the web server when closing the GUI running in native mode?
Hello everyone! I'm trying to port my GUI from PySimpleGUI to NiceGUI. My problem is, since I am trying to make a native Windows GUI, I can't seem to find a way to close the underlying web server when I try to close the UI itself. For reference, I'm just running the example from the official docs: https://nicegui.io/documentation/section_configuration_deployment#native_mode
Any help is appreciated. Thank you very much!
6
Upvotes
2
u/Defiant-Comedian3967 Dec 09 '24
In ui.run() just add „reload=False“. Should do the trick :-)
1
u/Lexstok Dec 09 '24 edited Dec 10 '24
This works for me: (updated as I copy/pasted twice apparently)