How to prevent Python application from automatically closing after reaching the code?

I am new to programming, especially Python. I am trying to make an application that converts Fahrenheit to a target, but I do not know how to make the program open. Whenever it reaches the end of the code, it automatically closes before the user can see its results. I am using Python 2.6.

+3
source share
4 answers

Well, I think you mean the terminal that Windows opens for you, when you run the python file, it closes too quickly. You can add raw_input('Press Enter to exit')right before the exit of your program. It tells Python to wait for input before exiting.

+7
source

, , . , Python - Windows. IDLE IDE ( ), script, , F5. , , , . , Python.

, IDLE, .

+3

Take a look at this question that solves this problem on Windows, and I assume this is your platform.

+1
source

ask the user to enter another variable and type "Press enter to exit ..."

0
source

Source: https://habr.com/ru/post/1734172/


All Articles