Newbie: Capture output of compile_dir
Denis S. Otkidach
ods at fep.ru
Tue Jul 16 07:05:01 EDT 2002
More information about the Python-list mailing list
Tue Jul 16 07:05:01 EDT 2002
- Previous message (by thread): Newbie: Capture output of compile_dir
- Next message (by thread): Newbie: Capture output of compile_dir
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, 15 Jul 2002, Becky Hehn wrote: BH> Thanks for the response. I tried the code you gave BH> me, but it didn't quite work like I wanted. I created BH> a syntax error in my python file (left out a quotation BH> mark) and tried the code. Below is the information BH> from my interpreter session: [...] BH> If an the prompt I just type the compile command, I BH> get all the output at once(see below). I would like BH> the output variable to contain all this feedback from BH> the compile_dir command. Not just the initial two BH> lines. Any thoughts on what I did wrong? Thank you BH> in advance. Informational messages from compile_dir go to stdout and error messages go to stderr. You should redefine both. orig_so = sys.stdout orig_se = sys.stderr sys.stdout = sys.stderr = captured = StringIO() ... -- Denis S. Otkidach http://www.python.ru/ [ru] http://diveinto.python.ru/ [ru]
- Previous message (by thread): Newbie: Capture output of compile_dir
- Next message (by thread): Newbie: Capture output of compile_dir
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list