There is a bug in idle caused by load_source, which switches the stdout of idle to something else. Here is what I did: Python 2.3.4 (#1, Nov 2 2004, 11🔞38) [GCC 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)] on linux2 [...i leave this out...] IDLE 1.0.3 >>> from sys import stdout >>> print stdout <idlelib.rpc.RPCProxy instance at 0x407914ac> >>> print 'a' a >>> from imp import load_source >>> print 'a' a >>> print stdout <idlelib.rpc.RPCProxy instance at 0x407914ac> >>> m = load_source('bug.py', 'bug.py', open('bug.py')) >>> print 'a' >>> print stdout >>> the file 'bug.py' contains the following line: from types import * meanwhile i see this on my terminal: a <idlelib.rpc.RPCProxy instance at 0x407914ac> when i type "import bug" or "from bug import *" everything works fine. This bug also works (at least for me) if I start idle from the the "Run Command" dialog under kde, instead of the terminal.
Logged In: YES user_id=149084 These low level imp module functions don't just import, they reload() the module. This destroys the redirection of stdin, stdout, stderr that IDLE has set up to work with Tkinter. Using IDLE without its subprocess, and with verbose output: hydra /home/kbk/PYSRC/Lib/idlelib$ ../../python -v ./PyShell.py -n # installing zipimport hook import zipimport # builtin # installed zipimport hook [...] In the IDLE shell: IDLE 1.2a0 ==== No Subprocess ==== >>> import sys >>> sys.stdout <__main__.PseudoFile object at 0x42feac> >>> reload(sys) >>> sys.stdout >>> And on the console: [...] import sys # previously loaded (sys) <module 'sys' (built-in)> <open file '', mode 'w' at 0xfa068> imp.load_source() is incompatible with IDLE. Please use the high level import statements. I didn't find any extra files.