python sys.stdout and C++ iostreams::cout

2013-01-17 Thread Utpal Sarkar
Hi, I was assuming that sys.stdout would be referencing the same physical stream as iostreams::cout running in the same process, but this doesn't seem to be the case. The following code, which makes a call to a C++ function with a python wrapper called "write", that writes to cout: from cStrin

Re: python sys.stdout and C++ iostreams::cout

2013-01-17 Thread Utpal Sarkar
Thanks a lot Chris and Nobody! I'll have a look at dup2 for a start. > > I was assuming that sys.stdout would be referencing the same physical > > stream as iostreams::cout running in the same process, but this doesn't > > seem to be the case. > > > > That's more-or-less true, but there will

non-owning references?

2009-07-24 Thread Utpal Sarkar
Hi, I'm not sure the subject describes what I'm looking for, but the question is the following: Is there a way I can tell a variable that the object it is pointing too is not owned by it, in the sense that if it is the only reference to the object it can be garbage collected? I want this for what