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

Oscar Benjamin oscar.j.benjamin at gmail.com
Thu Oct 22 07:10:00 EDT 2015


On 22 October 2015 at 11:56, Peter Brittain <peter.brittain.os at 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



More information about the Python-list mailing list