Urgent:Serial Port Read/Write

Chris Angelico rosuav at gmail.com
Thu May 9 11:54:48 EDT 2013


On Fri, May 10, 2013 at 1:35 AM, chandan kumar <chandan_psr at yahoo.co.in> wrote:
> Please find the attached script and let me know whats wrong in my script
> and also how can i read data from serial port for the  same script.

Don't do this:

    except serial.serialutil.SerialException:
        print "Exception"
        ser.close()

Just let it propagate up and show you a traceback. There is absolutely
no value in suppressing an exception only to print an unhelpful
message.

ChrisA



More information about the Python-list mailing list