How to get a handle on Windows STDOUT handles (in python)?
问题 I am trying to get a handle on Windows stdout handles. I need to understand why there are different handles for STDOUT ( CONOUT$ ?) and how to interpret these differences. I know there are different output buffers used by the Windows API, but failt to understand (from the many MSDN docs) when and how to, use them. Using ctypes and python3, I can get 2 of these by the script below. However, running the script in (Cygwin) mintty/bash , PowerShell (6.1.1), CMD or even ConEmu , all yield slightly