Path: csiph.com!goblin2!goblin.stu.neva.ru!newsfeed1.swip.net!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'win32': 0.03; '21,': 0.07; 'apis': 0.07; 'wednesday,': 0.07; 'wrapper': 0.07; 'api': 0.09; 'cc:addr:python-list': 0.09; 'abstraction': 0.09; 'modes': 0.09; 'received:openend.se': 0.09; 'received:theraft.openend.se': 0.09; 'python': 0.10; 'python.': 0.11; 'thu,': 0.15; '>on': 0.16; 'cc:addr:lac': 0.16; 'cc:addr:openend.se': 0.16; 'curses': 0.16; 'exposes': 0.16; 'from:addr:lac': 0.16; 'from:addr:openend.se': 0.16; 'from:name:laura creighton': 0.16; 'hides': 0.16; 'message- id:@fido.openend.se': 0.16; 'ncurses': 0.16; 'received:fido': 0.16; 'received:fido.openend.se': 0.16; 'subject:access': 0.16; 'wrote:': 0.16; 'laura': 0.18; 'restrictions': 0.18; 'platforms': 0.18; 'library': 0.20; 'versions': 0.20; 'windows': 0.20; '2015': 0.20; 'cc:addr:python.org': 0.20; 'cc:2**1': 0.22; 'meant': 0.22; 'code.': 0.23; "haven't": 0.24; 'url:edu': 0.24; 'module': 0.25; "i've": 0.25; 'linux': 0.26; 'error': 0.27; 'handling': 0.27; 'looks': 0.29; '-0700,': 0.29; 'expose': 0.29; 'received:se': 0.29; 'cc:no real name:2**1': 0.29; 'subject:/': 0.30; 'url:mailman': 0.30; 'probably': 0.31; 'older': 0.32; 'though,': 0.32; 'url:python': 0.33; 'impression': 0.33; "i'll": 0.33; 'url:listinfo': 0.34; 'case,': 0.34; 'mapping': 0.35; 'something': 0.35; 'level': 0.35; 'problem.': 0.35; 'according': 0.36; 'but': 0.36; 'url:org': 0.36; "wasn't": 0.36; 'subject:: ': 0.37; 'charset:us-ascii': 0.37; 'things': 0.38; 'does': 0.39; 'subject:-': 0.39; 'url:mail': 0.40; 'still': 0.40; 'header :Message-Id:1': 0.61; 'back': 0.62; 'above,': 0.63; 'different': 0.63; 'great': 0.63; 'interest': 0.64; 'due': 0.65; 'fall': 0.66; 'url:htm': 0.75; 'site:': 0.75; 'complexity': 0.84; 'header:In- reply-to:1': 0.84; 'humans': 0.84; 'wheel': 0.84; 'colour': 0.91; 'convinced': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openend.se; s=default; t=1445505824; bh=U4nY/qNKc38etR3aB/1gdVOgzoBoPAYD60Lh56YlgYE=; h=To:cc:From:Subject:In-reply-to:References:Date:From; b=RT3vKnjuTfoqg2sm3beDchauxNBs4QmReN0NNwVvF2gSHC7QWWtWYdqt5ulChlqFk /g4JZSUFvuR0xv1eSWNlIEZ8UbqLeRNUxUxdJgcjmncNAouuTpvAYFtXN6pY8pUylO DvU1DHqu8G9zol8Grih6rHWy7ekI8oIeQju2RUOI= To: Peter Brittain cc: python-list@python.org, lac@openend.se From: Laura Creighton Subject: Re: A high-level cross-platform API for terminal/console access In-reply-to: <0c3509e1-e27d-4804-88fb-b17d9d1172b4@googlegroups.com> References: <86bf9509-c512-4efa-9712-b51952a311e3@googlegroups.com> <0c3509e1-e27d-4804-88fb-b17d9d1172b4@googlegroups.com> Comments: In-reply-to Peter Brittain message dated "Thu, 22 Oct 2015 02:02:28 -0700." MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19697.1445505822.1@fido> Content-Transfer-Encoding: quoted-printable Date: Thu, 22 Oct 2015 11:23:42 +0200 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (theraft.openend.se [82.96.5.2]); Thu, 22 Oct 2015 11:23:44 +0200 (CEST) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 47 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1445505833 news.xs4all.nl 23757 [2001:888:2000:d::a6]:54628 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:97887 In a message of Thu, 22 Oct 2015 02:02:28 -0700, Peter Brittain writes: >On Wednesday, October 21, 2015 at 11:26:40 PM UTC+1, eryksun wrote: >> = >> Also check out the curses module that's available on Christoph Gohlke's= site: >> = >> http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses > >Neat. I wasn't aware of this library of wheel installations. I'll have = a look at how that works out and see if I can rationalize my mapping code.= = > >First impression is that this might be tricky, though, as I've had issues= with older Linux distributions using ncurses 5 and so handling 256 colour= modes has been difficult due to limits on colour pairs. This meant I had= to fall back to looking up and using codes in the terminfo database using= tigetstr. According to the PDcurses docs, these APIs are all just stubs = that return an error and so I'll probably need a curses and PDcurses mappi= ng layer from the looks of things - which is not much better than a curses= and win32 mapping layer. > >I'm also still not convinced that curses package is the right API to expo= se for Python. While ncurses does a great job of abstracting away the iss= ues of terminal inter-operation, the Python curses package is just a thin = wrapper of that C library and, as can be seen above, not truly cross-platf= orm due to the restrictions of PDcurses. > >Shouldn't we have a higher level simplification? Something that hides aw= ay all the complexity of handling all these different platforms and so exp= oses a simple API? One that humans can use without worrying about these i= ssues? >-- = >https://mail.python.org/mailman/listinfo/python-list Fredrik Lundh's console implementation http://effbot.org/zone/console-handbook.htm might be of interest in that case, but I think it is 'old versions of windows only'. But it's a different take on the abstraction = problem. I haven't used it for something like 15 years now, though, so can barely remember it ... Laura