Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'python': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:keys': 0.09; 'looked': 0.10; 'curses': 0.16; 'pygame': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.17; 'shell': 0.18; 'module': 0.19; 'keys': 0.22; 'header:User-Agent:1': 0.26; 'library.': 0.27; "doesn't": 0.28; 'header:X-Complaints-To:1': 0.28; 'attempting': 0.29; 'probably': 0.29; "i'm": 0.29; 'error': 0.30; 'url:python': 0.32; 'running': 0.32; 'could': 0.32; 'to:addr:python-list': 0.33; 'direction': 0.35; 'remote': 0.35; 'something': 0.35; 'there': 0.35; 'received:org': 0.36; 'but': 0.36; 'url:org': 0.36; 'url:library': 0.36; 'charset:us-ascii': 0.36; 'subject:: ': 0.38; 'url:docs': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'think': 0.40; 'within': 0.64; 'received:204': 0.72; 'article': 0.78; 'experiment': 0.84; 'received:204.14': 0.84; 'phil': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ned Deily Subject: Re: Read arrow keys Date: Wed, 20 Feb 2013 19:36:24 -0800 References: <51255C8A.7090302@bigpond.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 204.14.154.191 User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) 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: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361417816 news.xs4all.nl 6890 [2001:888:2000:d::a6]:49990 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39391 In article <51255C8A.7090302@bigpond.com>, Phil wrote: > I'm attempting to put a simple remote control program together and to do > so I need to check if the arrows are pressed. I could probably do this > with pyqt4 but I'm looking for something simple to experiment with. > > Pygame looked like a suitable solution but the error message makes me > think that pygame doesn't work from the console: > > "video system not initialized" > > Is there a simple way to read the direction keys within a while loop? You don't say which o/s platform(s) you are interested in but, if they are all unix-y and you don't mind running from a shell terminal session, you could just use the venerable curses module in the Python standard library. http://docs.python.org/3/library/curses.html -- Ned Deily, nad@acm.org