I have finally managed to link all my programs with a menu (trinket.io/python3/df7b99779e?runOption=console) to work. To make this work I needed to make another program.
When you want to go back to the menu call this function
from scriptexit import ScriptExit
class ScriptExit( Exception ):