In Python 3, add the following to the end of your code:
input('Press ENTER to exit')
This will cause the program to wait for user input, with pressing ENTER causing the program to finish.
You can double click on your script.py
file in Windows conveniently this way.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…