Skip to content

Instantly share code, notes, and snippets.

@strycore
Created February 22, 2011 21:37
Show Gist options
  • Save strycore/839462 to your computer and use it in GitHub Desktop.
Save strycore/839462 to your computer and use it in GitHub Desktop.
unplug life support
#!/usr/bin/python
import time
import os.path
while True:
if not os.path.exists("/dev/input/js0"):
break
else:
# Do stuff here
time.sleep(0.5)
print "quitting loop"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment