1

Without using sleep function from time package how can I give delay in python?

I am getting this error when I'm using time.sleep(10) function:

FATAL error: Read register at (0x00100020)

Arkistarvh Kltzuonstev
  • 6,824
  • 7
  • 26
  • 56
YASEEN
  • 15
  • 1

2 Answers2

3

You can use the delay function from pygame module

import pygame 

pygame.time.delay(1000)
# equivalient to time.sleep(1)

But the real solution is to fix the problem with the sleep function. Dit try something like this ?

pip uninstall time
pip install time
Xiidref
  • 1,456
  • 8
  • 20
  • Thanks for the answer, I will try and let you know. – YASEEN Jun 25 '19 at 10:58
  • I tried unistalling time using these commands pip uninstall time but it didn't work for python 2.7.8. How to uninstall time package ?? – YASEEN Jun 25 '19 at 12:17
  • You should follow the instruction that I found here https://michigantechit.teamdynamix.com/TDClient/KB/ArticleDet?ID=66715 – Xiidref Jun 25 '19 at 12:26
  • The error is : Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1056)'))) - skipping. – YASEEN Jun 25 '19 at 12:33
0

time.sleep() is not working because of output buffering.

Turn it Off then it will work. Same problem was with me and it worked for me.

For turn off output buffering, you can follow this Answer

Anil Gupta
  • 1,593
  • 1
  • 19
  • 21