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


Groups > comp.lang.python > #19958

Re: how to read serial stream of data [newbie]

From Peter Otten <__peter__@web.de>
Subject Re: how to read serial stream of data [newbie]
Date 2012-02-07 15:02 +0100
Organization None
References <e84f3af4-da6d-4ae9-8974-54354ec16307@b18g2000vbz.googlegroups.com> <roy-5854D8.00073507022012@news.panix.com> <cd2a40a2-5f6f-461c-9d02-f2e9e8732e6f@l14g2000vbe.googlegroups.com> <sY9Yq.12835$I33.11565@uutiset.elisa.fi>
Newsgroups comp.lang.python
Message-ID <mailman.5500.1328623332.27778.python-list@python.org> (permalink)

Show all headers | View raw


Antti J Ylikoski wrote:

> On 7.2.2012 14:13, Jean Dupont wrote:
>> ser2 = serial.Serial(voltport, 2400, 8, serial.PARITY_NONE, 1,
>> rtscts=0, dsrdtr=0, timeout=15)
> 
> In Python, if you want to continue the source line into the next text
> line, you must end the line to be continued with a backslash '\'.
> 
> So you should write:
> 
> ser2 = serial.Serial(voltport, 2400, 8, serial.PARITY_NONE, 1, \
> rtscts=0, dsrdtr=0, timeout=15)
> 
> and analogously.
> 
> Hope that this will help.  Andy.

This is wrong. A line with an open parenthesis is continued automatically:

>>> zip("abc",
... "def")
[('a', 'd'), ('b', 'e'), ('c', 'f')]
>>> ("abc"
... "def")
'abcdef'
>>> 1 + 2 + (
... 3)
6

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


Thread

how to read serial stream of data [newbie] Jean Dupont <jeandupont115@gmail.com> - 2012-02-06 13:40 -0800
  Re: how to read serial stream of data [newbie] Roy Smith <roy@panix.com> - 2012-02-07 00:07 -0500
    Re: how to read serial stream of data [newbie] Jean Dupont <jeandupont115@gmail.com> - 2012-02-07 04:13 -0800
      Re: how to read serial stream of data [newbie] Antti J Ylikoski <antti.ylikoski@tkk.fi> - 2012-02-07 15:48 +0200
        Re: how to read serial stream of data [newbie] Peter Otten <__peter__@web.de> - 2012-02-07 15:02 +0100
          Re: how to read serial stream of data [newbie] Antti J Ylikoski <antti.ylikoski@tkk.fi> - 2012-02-07 19:44 +0200
        Re: how to read serial stream of data [newbie] Heiko Wundram <modelnine@modelnine.org> - 2012-02-07 15:04 +0100
          Re: how to read serial stream of data [newbie] Jean Dupont <jeandupont115@gmail.com> - 2012-02-07 06:46 -0800
      Re: how to read serial stream of data [newbie] Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-02-07 12:44 -0500

csiph-web