python - Corrupted / Garbled Output when capturing stdout from IPython -
a similar question asked here: ipython redirect stdout display corruption , answer not satisfactory.
what i'm trying capture standard output, write pyqt4 qedittext while sending terminal normal.
i'm using python 2.7 , ubuntu 12.04 lts.
the problem when embed ipython terminal inside program, terminal output text gets garbled , lose autocomplete ability.
i able reproduce issue on ubuntu machine (the problem doesnt seem exist on windows).
in ubuntu termianl:
ipython import ipython.utils.io tee = ipython.utils.io.tee('fds')
right here text gets garbled while trying use tee object.
in program things little differently, boils down overwriting sys.stdout custom object , when write or flush gets called log captured text , send original stdout , pyqt4 gui.
so, there way safely peek @ standard out whenever write or flush command gets called? , there way doesn't break ipython terminals?
it's due special encoding coloring of text in terminal. try using 'ipython --classic'.
Comments
Post a Comment