main.py 461 B

12345678910111213141516171819
  1. #!/usr/bin/env python3
  2. import example_pages
  3. import home_page
  4. import theme
  5. from nicegui import ui
  6. # here we use our custom page decorator directly and just put the content creation into a separate function
  7. @ui.page('/')
  8. def index_page() -> None:
  9. with theme.frame('Homepage'):
  10. home_page.content()
  11. # this call shows that you can also move the whole page creation into a separate file
  12. example_pages.create()
  13. ui.run(title='Modularization Example')