I've been using the input function as a way to pause my scripts:
input
print("something") wait = input("Press Enter to continue.") print("something")
Is there a formal way to do this?
It Seems fine to me (or raw_input() in Python 2.X). Alternatively, you could use time.sleep() if you want to pause for a certain number of seconds.
raw_input()
time.sleep()
import time print("something") time.sleep(5.5) # Pause 5.5 seconds print("something")
2.1m questions
2.1m answers
60 comments
57.0k users