aboutsummaryrefslogtreecommitdiff
path: root/example-scripts/control-server/generate-cut-list.py
blob: 959ab58dd12cd1f72cac185c5df94ddb491d830a (plain)
  1. #!/usr/bin/env 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()