aboutsummaryrefslogtreecommitdiff
path: root/example-scripts/control-server/generate-cut-list.py
blob: 305ef8371373a8d61c89135b49362524b1fa5c6d (plain)
  1. #!/usr/bin/python3
  2. import socket
  3. import datetime
  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)