How to pause a program in Python

2 Answers

0 votes
import time

print("pause for 2 seconds...")

time.sleep(2)    

print("pause end")



     
'''
run:
     
pause for 2 seconds...
pause end
     
'''

 



answered May 1, 2021 by avibootz
0 votes
def pause():
    s = input("Press the <ENTER> key to continue...")

pause()

print("continue...")



     
'''
run:
     
Press the <ENTER> key to continue...
continue...
     
'''

 



answered May 1, 2021 by avibootz

Related questions

1 answer 156 views
1 answer 185 views
1 answer 237 views
1 answer 170 views
170 views asked May 19, 2025 by avibootz
...