Eryk Sun added the comment: Here's the ctypes code (mentioned on issue 1602) for writing to the input buffer and reading from the screen buffer. For output testing I also have a context manager to create and temporarily activate a new screen buffer with a given number of columns and rows and filled with a particular character (e.g. NUL), which makes it easier to read the output up to the current cursor position.
Activating the new screen can be factored out if you're just testing a child writing to stdout. I added the screen activation part in order to read the output from a program that was stubbornly writing to CONOUT$, ignoring the pipe that was passed as stdout. ---------- nosy: +eryksun Added file: http://bugs.python.org/file44764/conin.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28217> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com