Translations:RPi/40/de

From GIMX
Jump to: navigation, search

while True:

 found = False
 time.sleep(5)
 pids = [pid for pid in os.listdir('/proc') if pid.isdigit()]
 for pid in pids:
   try:
     cmd = open(os.path.join('/proc', pid, 'cmdline'), 'rb').read()
     if "gimx" in cmd:
       found = True
   except IOError: # proc has already terminated
     continue
 if found == True:
   GPIO.output(led, True)
 else:
   GPIO.output(led, False)