[C++-sig] Displaying PyErr_Print() error

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Thu Nov 27 18:23:26 CET 2003


--- Benjamin Collar <collar at gamic.com> wrote:
> 'write(self, stuff)' . Anything written is kept in an instance string. 
> Instantiate that class in the interpreter and replace sys.stderr with it. In 
> your catch, query that object for its string. 

A minor remark: you can use StringIO or cStringIO for this purpose. I.e. you
don't have to write a class with a write method yourself.
Ralf


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree




More information about the Cplusplus-sig mailing list