What a weird thing !!?
Fredrik Lundh
effbot at telia.com
Sat Feb 19 07:16:45 EST 2000
Florent Ramire <framiere at netcom-service.com> wrote:
> well, i thinked about this method, it can be suitable for my project,
> but in one only way: it has to be set one time for all ...
you still haven't explained why you're totally uncapable
of changing "print x" to e.g. "pr(x)" in your project, but
alright:
import sys
class florentStdout:
def write(self, str):
sys.__stdout__.write(str)
def __setattr__(self, attr, value):
pass
def __getattr__(self, attr):
return 0
# use non-standard print semantics
sys.stdout = florentStdout()
print "a",
print "b"
</F>
More information about the Python-list
mailing list