Alan,

We execute Python code in our integration to redirect its stdout; sys.stdout is 
the where the output of its print method goes by default.  We use a wrapped 
Python object on Windows that sends output via OutputDebugString; but you can 
send your output wherever you want.  You basically just need a Python object 
with a write method to accomplish this.  Create your Python object, then just 
reassign sys.stdout early in your implementation code like this:

sys.stdout = YourClass()



Scott V
Lead Software Architect
Canfield Imaging Systems
Fairfield, NJ

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stefan Seefeld
Sent: Monday, November 24, 2008 2:49 PM
To: Development of Python/C++ integration
Subject: Re: [C++-sig] console I/O

Alan Baljeu wrote:
> I followed the directions there, but that is incomplete.  I can printf from C 
> to the console, but print from Python does nothing.  Something in the Python 
> API must be employed.  But perhaps I should take this to the main Python list.
>

Definitely.

Regards,
       Stefan


--

      ...ich hab' noch einen Koffer in Berlin...

_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to