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


Groups > comp.lang.python > #44086

Re: kbhit/getch python equivalent

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.053
X-Spam-Evidence '*H*': 0.89; '*S*': 0.00; '22,': 0.09; 'python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'mon,': 0.24; 'equivalent': 0.26; 'subject:/': 0.26; 'header:In-Reply-To:1': 0.27; 'external': 0.29; 'errors': 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'breaking': 0.31; 'controlled': 0.31; 'received:209.85': 0.35; 'received:209.85.220': 0.35; 'received:google.com': 0.35; 'received:209': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'catch': 0.60; 'hardware': 0.61; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=bnEX5gI9JEBHe8ijNx/AiXC9RxjCIiqErJhyVHzun4Y=; b=aEqqhGO+JUztWpnGo5iyVaajukJFOnH172N5H/khoDG6xCoJABILwEJCJw0nviGOtn AZC67fdsewooB2jJpHtKeTlyrYfpBJqKQxRMp15UwSny7emWrUeuPBfYojL0zfPgaK1A lJ4Ygwk3GUYSIDvRMjMZ4iESbQtlqkNNWarwnDpGZFL/QHGA2loT2WWFXJyi2yQ7pazo SuXS8hQ10cHvh281VjVkkCBShp20uHOXlH4bpR9tcnJOdRQUrZtF+RUBwUtSlH0LBiWG 1E7mi2jmb/jtuq7I0Pfg6KgGsvrrf7a0yyV6TJPGltwfuf3FQJdtKfqnoxSTh+ue27Gh qgzQ==
MIME-Version 1.0
X-Received by 10.58.75.46 with SMTP id z14mr19120582vev.52.1366643301138; Mon, 22 Apr 2013 08:08:21 -0700 (PDT)
In-Reply-To <atksiaFtt00U1@mid.individual.net>
References <atksiaFtt00U1@mid.individual.net>
Date Tue, 23 Apr 2013 01:08:21 +1000
Subject Re: kbhit/getch python equivalent
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.924.1366643310.3114.python-list@python.org> (permalink)
Lines 9
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1366643310 news.xs4all.nl 2212 [2001:888:2000:d::a6]:39962
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:44086

Show key headers only | View raw


On Mon, Apr 22, 2013 at 11:34 PM, alb <alessandro.basili@cern.ch> wrote:
> I'm looking for a kbhit/getch equivalent in python in order to be able
> to stop my inner loop in a controlled way (communication with external
> hardware is involved and breaking it abruptly may cause unwanted errors
> on the protocol).

Catch KeyboardInterrupt and hit Ctrl-C.

ChrisA

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


Thread

kbhit/getch python equivalent alb <alessandro.basili@cern.ch> - 2013-04-22 15:34 +0200
  Re: kbhit/getch python equivalent Peter Otten <__peter__@web.de> - 2013-04-22 16:00 +0200
  Re: kbhit/getch python equivalent Grant Edwards <invalid@invalid.invalid> - 2013-04-22 14:10 +0000
  Re: kbhit/getch python equivalent Chris Angelico <rosuav@gmail.com> - 2013-04-23 01:08 +1000
  Re: kbhit/getch python equivalent woooee@gmail.com - 2013-04-22 13:30 -0700
  Re: kbhit/getch python equivalent xDog Walker <thudfoo@gmail.com> - 2013-04-30 07:06 -0700

csiph-web