python script, ( py2exe, ). python pyserial. script :
import time
import serial
interval = 2.5
repetitions = 10
command_string = "Hello World"
command_bytes = [0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64]
command_string = "".join([chr(c) for c in command_bytes])
ser = serial.Serial(
port=0, # This is COM1, use 1 for COM2 etc
baudrate=115200,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
xonxoff=0,
rtscts=0,
timeout=0)
for i in range(repetitions):
ser.write(command_string)
time.sleep(interval)
, Windows, , , Docklight, , Docklight Scripting ( ).