tqjustc
tqjustc

Reputation: 3824

how to pause a script of python

I tried time.sleep(secs). However this has to sleep for some specific seconds. It is not totally paused. Does Python have any function to pause the script forever if there is no any input ? Thanks !

Upvotes: 1

Views: 182

Answers (2)

avoid3d
avoid3d

Reputation: 620

If you just want to pause until keyboard entry try:

raw_input("press enter")

Upvotes: 3

ide
ide

Reputation: 20838

sys.stdin.readline() blocks until you enter input.

Upvotes: 2

Related Questions