How to use 'python pause' in Python

Every line of 'python pause' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
186def pause() -> None:
187 """
188 Pauses the process until a signed is received.
189 Windows does not have a signal.pause() so we waste a few more cpu cycles.
190 :return: None
191 """
192 if os.name == "nt":
193 while True:
194 time.sleep(60)
195 else:
196 signal.pause()
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

41def pause(duration):
42 ''' basic sleep with periodic logging (to show progess) '''
43 interval = 10
44 tick = duration / interval
45 for i in xrange(interval):
46 logger.info(u"Pause (%dmn) Elapsed: %dmn" % (duration / one_minute,
47 tick * i / one_minute))
48 time.sleep(tick)

Related snippets