Skip to content

Instantly share code, notes, and snippets.

@johngrantuk
Created July 20, 2017 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johngrantuk/810c5783ad0df3bdd445ecbcb9156d77 to your computer and use it in GitHub Desktop.
Save johngrantuk/810c5783ad0df3bdd445ecbcb9156d77 to your computer and use it in GitHub Desktop.
def WorkCheck():
try:
# HERE SOME INITIAL WORK IS DONE THAT SCRIPTS 1 & 2 NEED TO WAIT FOR
# IDs SERIAL PORTS
# SAVE TO db
r = redis.StrictRedis(host='localhost', port=6379) # Connect to local Redis instance
p = r.pubsub() # See https://github.com/andymccurdy/redis-py/#publish--subscribe
print("Starting main scripts...")
r.publish('startScripts', 'START') # PUBLISH START message on startScripts channel
print("Done")
except Exception as e:
print("!!!!!!!!!! EXCEPTION !!!!!!!!!")
print(str(e))
print(traceback.format_exc())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment