Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.021 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'string.': 0.04; 'mrab': 0.05; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; '"),': 0.16; 'end).': 0.16; 'tried:': 0.16; 'string': 0.17; 'wrote:': 0.17; 'cc:2**0': 0.23; 'monday,': 0.23; 'cc:no real name:2**0': 0.24; 'command': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'chris': 0.28; 'name?': 0.29; 'words': 0.29; 'included': 0.29; 'connection': 0.30; 'returned': 0.30; 'error': 0.30; 'asking': 0.32; 'could': 0.32; 'traceback': 0.33; 'received:google.com': 0.34; 'screen': 0.34; 'received:209.85': 0.35; 'closing': 0.36; 'does': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'fact': 0.38; 'mean': 0.38; 'space': 0.39; 'subject:-': 0.40; 'end': 0.40; 'from:no real name:2**0': 0.60; 'chance': 0.61; 'close': 0.63; 'dont': 0.64; '2013': 0.84; 'sorry.': 0.91 X-Received: by 10.50.152.232 with SMTP id vb8mr1315675igb.16.1361829164272; Mon, 25 Feb 2013 13:52:44 -0800 (PST) Newsgroups: comp.lang.python Date: Mon, 25 Feb 2013 13:52:43 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=199.181.155.130; posting-account=NWckLgoAAAA_ESRKeclDK3J-ZCP6LE-U References: <9qya2949lwvwn69b2oqy5xya.1361820262242@email.android.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 199.181.155.130 MIME-Version: 1.0 Subject: Re: telnet to Cognex In-Sight 4001 camera From: chris.annin@gmail.com To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361829168 news.xs4all.nl 6952 [2001:888:2000:d::a6]:49281 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39914 On Monday, February 25, 2013 1:15:54 PM UTC-8, MRAB wrote: > On 2013-02-25 20:27, Chris Annin wrote: >=20 > > Ive tried: read_until("Login: "), read_until("User: ") and read_all() >=20 > > all 3 ways return the same thing: "Welcome to In-Sight(R) 4001 Session >=20 > > 1\r\nUser:" >=20 > > >=20 > [snip] >=20 > Does the returned string end exactly with "User:" (no space at the >=20 > end)? I ask because you're asking it to read until "User: " (space at >=20 > the end). yes it does have the space - sorry. does it make a difference if I use tn.r= ead_until vs tn.read_all? will it close the connection or not accept a wri= te command if I dont read_until? the fact that I get a traceback error wh= en I read_until and I get ",,," when I use read_all - does this mean the co= nnection has been closed? also when I try tn.open(host) it will give me the welcome screen with the w= ords "session 1" included in the string. if I then immediately try tn.open= (host) again it will give me the same welcome message with "session 1" cou= ld the connection be closing before I get a chance to write the user name?