Add this line at end of any script
input("Press any Key")
or use time module
import time // Your code time.sleep(10)
there will be an delay for the next line to execute, so for 10 seconds your screen will wait and then close.