I'm writing a tkinter python app that is meant to run on a raspberry pi. When I run the code from the build in IDE on the pi it runs fine and the window opens up, same on IDLE on my windows PC,  however when I try and run the program from the command line, it does nothing when I hit enter on the command python3 filename. As well as this, when I enter the python shell from the command line I am able to get a tkinter window to appear using root = Tk(), so I cannot figure out why my program won't run.
I've now fixed this myself so posting the answer in case anyone needs it. My mainloop() function was actually MainPage.mainloop() which for some reason stopped the window from opening from the command prompt...
Tkinter app runs on windows but doesn't open window on raspberry pi