arduino = Arduino(3) #This sets the arduino to serial port 2. On PC's this will probably be COM3 # On macs this port will be something like /dev/tty.usbmodemarduino.writeLine('!') #The arduino program resets all the led's when it recieves '!' over serial

arduino.writeLine('!') #when you exit the UI, all the LED's are reset to 'off'print '!'arduino.connection.close() #The serial connection is also closed when you quit, so you can switch between programming in python and the arduino IDE without resetting your arduino

arduino = Arduino(3) #This sets the arduino to serial port 2. On PC's this will probably be COM3 # On macs this port will be something like /dev/tty.usbmodemarduino.writeLine('!') #The arduino program resets all the led's when it recieves '!' over serial

arduino.writeLine('!') #when you exit the UI, all the LED's are reset to 'off'print '!'arduino.connection.close() #The serial connection is also closed when you quit, so you can switch between programming in python and the arduino IDE without resetting your arduino