On Sat, Sep 2, 2017 at 5:53 AM, Steve D'Aprano <steve+pyt...@pearwood.info> wrote: > > The problem is that after the message is printed, the REPL's prompt is > disrupted. This is especially annoying when I'm in the middle of typing a > line. > This is just a cosmetic flaw, but it would be nice if I could tell Python to > redraw the current line.
This would be difficult on Windows. When the REPL reads from the console, the main thread blocks on a system call, which varies depending on the versions of Python and Windows. This is a remote procedure call to the console host process (e.g. conhost.exe in Windows 7+), which handles the cooked read while Python waits for the result. To get the level of control you're asking for, we'd have to implement readline for the Windows console using low-level console functions such as ReadConsoleInput. pyreadline currently implements this via ctypes, but CPython would need a C extension. -- https://mail.python.org/mailman/listinfo/python-list