V
V
Vitaly2020-06-09 18:31:17
Python
Vitaly, 2020-06-09 18:31:17

Why doesn't the python program work?

Something is wrong with the program, it either starts and asks for a value for input, then displays the following code and immediately closes, I don’t have time to see anything, or a window just appears and it immediately closes. I checked this code in online compilers, everything works there (although not always). What could be the reason? Version for x64 and I clicked on the checkmark when they offered to install it in the PATH variable.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
Ulukman Amangeldiev, 2020-06-09
@DavidFosterWallace

Import the time module at the beginning of your program.
Then write your code and insert time.sleep(10) at the end.
This way your console will close 10 seconds after all the code has been executed.
PS: You can write your number of seconds in brackets.

import time
#ваш код
#много вашего кода

time.sleep(10)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question