fork download
  1. import time
  2. from ctypes import Structure, windll, c_uint, sizeof, byref
  3.  
  4. class LASTINPUTINFO(Structure):
  5. _fields_ = [
  6. ('cbSize', c_uint),
  7. ('dwTime', c_uint),
  8. ]
  9.  
  10. def get_idle_duration():
  11. lastInputInfo = LASTINPUTINFO()
  12. lastInputInfo.cbSize = sizeof(lastInputInfo)
  13. windll.user32.GetLastInputInfo(byref(lastInputInfo))
  14. millis = windll.kernel32.GetTickCount() - lastInputInfo.dwTime
  15. return round(millis / 1000.0)
  16. loopTimer = 1
  17. while (loopTimer < 10):
  18. time.sleep(1)
  19. loopTimer = loopTimer + 1
  20. print(loopTimer)
  21. if (get_idle_duration() == 5):
  22.  
  23.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Traceback (most recent call last):
  File "/usr/lib/python3.5/py_compile.py", line 125, in compile
    _optimize=optimize)
  File "<frozen importlib._bootstrap_external>", line 735, in source_to_code
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "./prog.py", line 22
    
    ^
SyntaxError: unexpected EOF while parsing

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.5/py_compile.py", line 129, in compile
    raise py_exc
py_compile.PyCompileError:   File "./prog.py", line 22
    
    ^
SyntaxError: unexpected EOF while parsing

stdout
Standard output is empty