Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45043

Re: Urgent:Serial Port Read/Write

References <1368113753.5157.YahooMailClassic@web190506.mail.sg3.yahoo.com>
Date 2013-05-10 01:54 +1000
Subject Re: Urgent:Serial Port Read/Write
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1497.1368114897.3114.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, May 10, 2013 at 1:35 AM, chandan kumar <chandan_psr@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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Urgent:Serial Port Read/Write Chris Angelico <rosuav@gmail.com> - 2013-05-10 01:54 +1000

csiph-web