[Python-ideas] Default value for input

Andrew Barnert abarnert at yahoo.com
Fri Apr 4 02:55:14 CEST 2014


On Apr 3, 2014, at 6:52, Paul Moore <p.f.moore at gmail.com> wrote:

> If the aim is cross-platform rich(er) console applications, wouldn't
> supporting curses on all environments be the easiest answer? AFAIK,
> there are curses ports for Windows, and it's native to all other
> platforms Python supports - so just shipping something like pdcurses
> in the Windows installer would do the trick. Or am I missing some
> fundamental reason why curses doesn't cover what's needed (and more)?

First, is pdcurses still a live/working project? Does it work with Python's curses module? If so, that might be worth doing entirely independent of whether it covers what's needed for this thread. I suspect the main argument against it is that there are so few people writing curses apps in Python who care about Windows that nobody's bothered to even ask for it, much less do it.

Meanwhile, if you go back to the start of this thread, really he wants normal terminal I/O with readline-like input or the platform's normal equivalent, except that he can pre-fill the input buffer. I think that would be a lot more work with curses than with readline. The question is whether there's a way to do it cross-platform, e.g., with cmd.exe line-editing. If so, that's probably easier than using curses. If not, then curses is certainly better than there being no way to do it, or than emulating line editing from scratch on top of console I/O and/or control sequences.



More information about the Python-ideas mailing list