Advertisement
Guest User

siri_notes_control

a guest
Jan 14th, 2015
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. import commands
  2. import time
  3. lichtan = False
  4. getnotes = "python inotes.py -c inotes.cfg -l"
  5. while True:
  6.     notes = str(commands.getstatusoutput(getnotes))
  7.     print notes
  8.     if notes.endswith("an')") and lichtan is False:
  9.         print 'LICHT AN'
  10.         lichtan = True     
  11.     elif notes.endswith("aus')") and lichtan:
  12.         print 'LICHT AUS'
  13.         lichtan = False
  14.     else:
  15.         print 'No Action'  
  16. time.sleep(10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement