+ 1
Why when I open a file with .py extension after executing the code it automatically closes?And How can I prevent it from closing
2 Answers
+ 1
You can place an anonymous input() statement at the end.
If you wanted to be fancy, you can put a "Press ENTER to exit" quote within.
The above are basic implementations.
You can certainly run a function at the end, which runs an input() statement, too - by doing this, you've made an 'out of bounds catcher'! Congrats.