The main.py file - Kyuchumimo/Micro-Joy-Home-Video-Computer GitHub Wiki
This file is executed after boot.py. Think of it as a smart device launcher.
This file lists all your files and folders in the file system, runs programs and displays debugging information in case of errors. You can navigate in and out of other folders with it.
The launcher only runs programs with .py extension. If you try to run a program that does not have this extension, you are likely to get an error.
If the program finishes successfully, the computer will reset (essentially clearing all memory) and return to this screen, but the program must be designed for it, for example with an exit option in a menu that changes the loop condition, or break argument inside that makes the infinite loop terminate after certain conditions or actions. If the program just runs infinitely, you can use the reset (RUN) button to restart the computer and run a different program.
If an error occurs during program execution, a red screen will appear showing the error.
This file must be present in the root of the internal memory of the microcontroller.