[IPython-dev] IPython 0.9.1 and sys.stdin
Nicolas Rougier
Nicolas.Rougier at loria.fr
Mon Apr 6 10:10:04 EDT 2009
Hi,
I've question regarding stdin ipython handling. If I try to run
interactively the following script:
import sys
#import IPython
class TerminalIn:
def __init__(self): pass
def close(self): pass
flush = close
def isatty(self): return True
def read(self, a): return self.readline()
def readline(self): return '"q"'
def readlines(self): return []
def write(self, s): return None
def writelines(self, l): return None
sys.stdin = TerminalIn()
and then type 'help()' in the console, depending on the IPython
import, I get different results. If I do not include IPython, the help
exists immediately (as expected) while if I import IPython, the help
does not exit immediately, making me think that IPython is changing
something without any kind of warning.
Nicolas
More information about the IPython-dev
mailing list