Where does Python's interactive prompt “>>>” output to?
I've run into a somewhat unusual situation. I'm trying to script the interactive console (for teaching/testing purposes), and I tried the following: $ python > /dev/null Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> print 3 >>> 3 isn't printed, so clearly everything else was on stderr . So far so good. But then we redirect stderr : $ python 2> /dev/null >>> print 3 3 >>> How can the prompt be printed in both cases? EDIT: Redirecting both stdout and stderr