Sample Code For Logging

Below is the content of the logging activation and deactivation script used for Introduction to Junior and Dynamism.

import dy
import math
import time
import sys
 
hostname = 'localhost'
host = None
speed = 1.0
 
if len(sys.argv) >= 2:
    hostname = sys.argv[1]
host = dy.network.connect(hostname,8650)
 
ds = dy.data.path(hostname)
 
dy.signal.send_to(host,'logger_start')
 
raw_input('Press ENTER to stop logging')
dy.signal.send_to(host,'logger_stop')