Reputation: 347
I have the following code:
import signal
alive = 0
if alive > 0:
signal.setitimer(signal.ITIMER_REAL, 0.0005)
else:
signal.setitimer(signal.ITIMER_REAL, 0)
Error:
signal.setitimer(signal.ITIMER_REAL, 0)
AttributeError: 'module' object has no attribute 'setitimer'
Why is this error occurring?
Upvotes: 0
Views: 521
Reputation: 369064
signal.setitimer
is only available in Unix. You can't use it in Windows.
signal.setitimer(which, seconds[, interval])
...
Availability: Unix.
Upvotes: 2