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


Groups > comp.lang.python > #97885

Re: A high-level cross-platform API for terminal/console access

X-Received by 10.67.1.102 with SMTP id bf6mr11699705pad.19.1445504549124; Thu, 22 Oct 2015 02:02:29 -0700 (PDT)
X-Received by 10.50.50.179 with SMTP id d19mr357983igo.7.1445504549093; Thu, 22 Oct 2015 02:02:29 -0700 (PDT)
Path csiph.com!xmission!news.glorb.com!kq10no25277238igb.0!news-out.google.com!z4ni28451ign.0!nntp.google.com!kq10no25277231igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.python
Date Thu, 22 Oct 2015 02:02:28 -0700 (PDT)
In-Reply-To <mailman.77.1445466382.878.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=2620:104:4000:2067:ad5d:38f9:551:62ba; posting-account=uQ317QoAAAD4CnckOCn3xcbA-2Tr4r1F
NNTP-Posting-Host 2620:104:4000:2067:ad5d:38f9:551:62ba
References <bedf13c2-d34d-4d34-b72d-587afa79825c@googlegroups.com> <mailman.76.1445456525.878.python-list@python.org> <86bf9509-c512-4efa-9712-b51952a311e3@googlegroups.com> <mailman.77.1445466382.878.python-list@python.org>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <0c3509e1-e27d-4804-88fb-b17d9d1172b4@googlegroups.com> (permalink)
Subject Re: A high-level cross-platform API for terminal/console access
From Peter Brittain <peter.brittain.os@gmail.com>
Injection-Date Thu, 22 Oct 2015 09:02:29 +0000
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Xref csiph.com comp.lang.python:97885

Show key headers only | View raw


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 mapping 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 expose for Python.  While ncurses does a great job of abstracting away the issues 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-platform due to the restrictions of PDcurses.

Shouldn't we have a higher level simplification?  Something that hides away all the complexity of handling all these different platforms and so exposes a simple API?  One that humans can use without worrying about these issues?

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


Thread

A high-level cross-platform API for terminal/console access Peter Brittain <peter.brittain.os@gmail.com> - 2015-10-21 11:30 -0700
  Re: A high-level cross-platform API for terminal/console access Laura Creighton <lac@openend.se> - 2015-10-21 21:41 +0200
    Re: A high-level cross-platform API for terminal/console access Peter Brittain <peter.brittain.os@gmail.com> - 2015-10-21 15:18 -0700
      Re: A high-level cross-platform API for terminal/console access eryksun <eryksun@gmail.com> - 2015-10-21 17:26 -0500
        Re: A high-level cross-platform API for terminal/console access Peter Brittain <peter.brittain.os@gmail.com> - 2015-10-22 02:02 -0700
          Re: A high-level cross-platform API for terminal/console access Laura Creighton <lac@openend.se> - 2015-10-22 11:23 +0200
            Re: A high-level cross-platform API for terminal/console access Peter Brittain <peter.brittain.os@gmail.com> - 2015-10-22 03:56 -0700
              Re: A high-level cross-platform API for terminal/console access Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2015-10-22 12:10 +0100
  Re: A high-level cross-platform API for terminal/console access "Gisle Vanem" <gvanem@yahoo.no> - 2015-10-22 13:22 +0200
    Re: A high-level cross-platform API for terminal/console access Peter Brittain <peter.brittain.os@gmail.com> - 2015-10-22 05:04 -0700
  Re: A high-level cross-platform API for terminal/console access Chris Angelico <rosuav@gmail.com> - 2015-10-22 23:09 +1100
  Re: A high-level cross-platform API for terminal/console access "Gisle Vanem" <gvanem@yahoo.no> - 2015-10-22 14:42 +0200
    Re: A high-level cross-platform API for terminal/console access Peter Brittain <peter.brittain.os@gmail.com> - 2015-10-24 02:40 -0700
  Re: A high-level cross-platform API for terminal/console access Chris Angelico <rosuav@gmail.com> - 2015-10-22 23:48 +1100
  Re: A high-level cross-platform API for terminal/console access Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2015-10-22 13:56 +0100

csiph-web