#!/usr/bin/env python
# Resets an Arduino Leonardo connected at 'serialPort' (specified
# on the command line) to prepare it for a firmware update

import serial, sys
serialPort = sys.argv[1]
ser = serial.Serial(
    port=serialPort,
    baudrate=1200,
    parity=serial.PARITY_NONE,
    stopbits=serial.STOPBITS_ONE,
    bytesize=serial.EIGHTBITS
)
ser.isOpen()
ser.close()
