We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import typer from nicegui import ui def main( port: int = 5123, ): @ui.page('/') def main_page(): ui.label('Hello NiceGUI!') ui.icon('thumb_up') ui.markdown('This is **Markdown**.') ui.html('This is <strong>HTML</strong>.') with ui.row(): ui.label('CSS').style('color: #888; font-weight: bold') ui.label('Tailwind').classes('font-serif') ui.label('Quasar').classes('q-ml-xl') ui.link('NiceGUI on GitHub', 'https://github.com/zauberzeug/nicegui') ui.run(port=5123, dark=None) if __name__ in {"__main__", "__mp_main__"}: #main() #Works typer.run(main) #Does not work
No debug output, it just doesn't run.
The text was updated successfully, but these errors were encountered:
You need to set reload=False:
reload=False
import typer from nicegui import ui def main(port: int = 5123): @ui.page('/') def main_page(): ui.label('Hello NiceGUI!') ui.run(port=port, reload=False) if __name__ in {"__main__", "__mp_main__"}: typer.run(main)
This seems to be caused by the fact that the reloader (watchdog package) runs the file twice: https://github.com/zauberzeug/nicegui/wiki/FAQs#why-is-my-code-executed-twice
Sorry, something went wrong.
No branches or pull requests
No debug output, it just doesn't run.
The text was updated successfully, but these errors were encountered: