summaryrefslogtreecommitdiff
path: root/example-scripts/control-server/generate-cut-list.py
blob: 59519c19955ed32849e4c2fa93ed84886fc77da6 (plain)
  1. #!/usr/bin/python3
  2. import socket
  3. import datetime
  4. import sys
  5. host = 'localhost'
  6. port = 9999
  7. conn = socket.create_connection( (host, port) )
  8. fd = conn.makefile('rw')
  9. for line in fd:
  10. words = line.rstrip('\n').split(' ')
  11. signal = words[0]
  12. args = words[1:]
  13. if signal == 'message' and args[0] == 'cut':
  14. ts = datetime.datetime.now().strftime("%Y-%m-%d/%H_%M_%S")
  15. print(ts)
  16. sys.stdout.flush()