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


Groups > comp.lang.python > #97892

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

Path csiph.com!eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Return-Path <oscar.j.benjamin@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.018
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'api': 0.09; 'cc:addr :python-list': 0.09; '22,': 0.09; 'abstraction': 0.09; 'creighton': 0.09; 'though...': 0.09; 'python': 0.10; 'thursday,': 0.13; 'cc:name:python list': 0.16; 'curses': 0.16; 'something.': 0.16; 'subject:access': 0.16; 'wrote:': 0.16; 'looked': 0.16; 'laura': 0.18; 'pfxlen:0': 0.18; 'project,': 0.18; 'versions': 0.20; 'windows': 0.20; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'installation': 0.23; "haven't": 0.24; 'thanks,': 0.24; 'header:In-Reply-To:1': 0.24; "i've": 0.25; 'message-id:@mail.gmail.com': 0.27; 'then.': 0.27; 'function': 0.28; 'this.': 0.28; 'expose': 0.29; 'subject:/': 0.30; 'creating': 0.30; 'certainly': 0.30; 'posts': 0.30; 'another': 0.32; 'though,': 0.32; 'maybe': 0.33; 'jump': 0.33; 'case,': 0.34; 'covered': 0.34; 'received:google.com': 0.35; 'next': 0.35; 'could': 0.35; 'mapping': 0.35; 'something': 0.35; 'problem.': 0.35; 'but': 0.36; 'should': 0.36; 'there': 0.36; 'url:org': 0.36; 'created': 0.36; 'possible': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'thanks': 0.37; 'missing': 0.37; 'front': 0.38; 'feedback': 0.38; 'represent': 0.38; 'why': 0.39; 'enough': 0.39; 'subject:-': 0.39; 'rather': 0.39; 'where': 0.40; 'some': 0.40; 'more': 0.63; 'different': 0.63; 'interest': 0.64; 'due': 0.65; 'else.': 0.66; 'person.': 0.70; 'url:htm': 0.75; 'hoping': 0.77; '"just': 0.84; 'oscar': 0.84; 'pain': 0.84; 'pip': 0.84; 'have.': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=7sDyXdnUmK7YVteUm5KjAfnHYrVxc3TmyognoT8YgTA=; b=xYBS718l9ANgyY6IpjpjWK8CKsc5ApuZ6XQN8RaGvaAbpftH1bt0eV7d8KsNFZTUU8 RG82hXMAc3iTzQ0l3liLFfJI9ABU1ChmMMl+S+uQnRCC/9+5PGoNwkuz647OBCRjOhjK 1Yug0+soGvW7LiXtFi+nYf4G4o4wnXHeoRc2hH/T6F6cLMda80U63UwS+Z/Afu53OWNr OPS+0v+aC/1S8lTRnysOG9dpxrhBmBExeijX2ylaEQNZuv8YzfuqZXjukHJlyqNDkxIH h77/X+BveYYpm2E1TICbJLz7Yrngcw6AwVkH+OaD+TKxhIAOl9UcZml/t2wczpECw5n0 3lBQ==
X-Received by 10.25.30.84 with SMTP id e81mr5337425lfe.48.1445512220282; Thu, 22 Oct 2015 04:10:20 -0700 (PDT)
MIME-Version 1.0
In-Reply-To <e8882d96-13e6-44bf-b6df-bebefa9b561c@googlegroups.com>
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> <0c3509e1-e27d-4804-88fb-b17d9d1172b4@googlegroups.com> <mailman.88.1445505833.878.python-list@python.org> <e8882d96-13e6-44bf-b6df-bebefa9b561c@googlegroups.com>
From Oscar Benjamin <oscar.j.benjamin@gmail.com>
Date Thu, 22 Oct 2015 12:10:00 +0100
Subject Re: A high-level cross-platform API for terminal/console access
To Peter Brittain <peter.brittain.os@gmail.com>
Cc Python List <python-list@python.org>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.91.1445512228.878.python-list@python.org> (permalink)
Lines 45
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1445512228 news.xs4all.nl 23763 [2001:888:2000:d::a6]:56430
X-Complaints-To abuse@xs4all.nl
X-Received-Bytes 6360
X-Received-Body-CRC 2457580536
Xref csiph.com comp.lang.python:97892

Show key headers only | View raw


On 22 October 2015 at 11:56, Peter Brittain <peter.brittain.os@gmail.com> wrote:
> On Thursday, October 22, 2015 at 10:24:11 AM UTC+1, Laura Creighton wrote:
>> 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 ...
>
> Thanks, but I think this is already covered in my original post: I couldn't use it directly due to the pip installation restriction.  I've now created a working Windows implementation, so I don't need another mapping for win32.
>
> More generally, as these posts begin to show, there was no _simple_ way for me to get a cross-platform console API that "just worked" out of the box.  I've had to jump through various hoops to get to where I am and don't think that other people should have to go through the same pain as I have.

I've looked for this in the past and I also found that there was no
general solution that I could just pick and use for both Windows and
everything else. Even just writing a cross-platform getch function is
needlessly complicated.

> This is one of the reasons why I've been tidying up my package to make this as simple as possible for the next person.  I've now got to the stage where I have something that works for me, but it is almost certainly missing something.  Maybe it's not good enough documentation, maybe there's some clunkiness left in the API due to the history of the project, maybe there's an even better way to represent terminals than what I've come up with so far?
>
> I was hoping for feedback on this front rather than other ways I could recreate the curses package - unless of course, the general consensus is that this really is the way that Python should expose access to the terminal/console.

Thanks for creating this. I will try it out when I next want to create
something like this and give some feedback then. I don't really know
when that will be though...

--
Oscar

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