Programs on the device are saved in two files
program_name.m5b (used only by uiflow to put the project back into the editor)
program_name.py (generated python code based on your project in uiflow). This file is run on the target device.
You can use the import program_name.py statement in your program in the execute block. Then it will be loaded and run.
But this method has its drawbacks, because the initialization instructions at the beginning of the program will be reloaded. You have to be careful what variable names you use, so that you don't overwrite the variable values with new ones from the imported file.
The import statement imports the code the first time and runs it, subsequent imports of the same file just load it into memory without running it (you can find a solution to this problem on google.
Ewentually you could edit your python code before upload to device with this way to solve above problem
def main():
# place whole generated python
# file in this function with
# proper intend
main()