Multi-page label presentation

One quick option for “importing but not running” is to change each of your separate apps so that the actual app code is wrapped in a function, like this:

def main():
    ... # app code codes here

def other_functions():
   ....

if __name__ == "__main__":
    main()

This means that if you run the app as a script (which is what happens when you click on the page) it will run the main function, but if you just import it, it won’t run the code in your functions.

3 Likes