Python:How To Run A Python Script Inside Another Script And Close Itself Immediately : I Have a login frame and a main frame that made from pyqt, I want to run the main command after i clicked the button and when the main code runs close the login frame

I wrote a def for clicking button but when the command executed the main frame still waits till i close the main window.

this is the function of clicking button :

    def ButtonClicked(self):

           os.system('py Main.py')
           self.os.exit()

How can i make the closing part immediately and not waiting for main.py to exit 
