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