On Sep 25, 9:04 pm, Sean DiZazzo <[EMAIL PROTECTED]> wrote: > On Sep 25, 6:01 pm, [EMAIL PROTECTED] wrote: > > > My SimpleXMLRPCServer program prints to stderr a line like > > this for each request: > > > ohm..pixar.com - - [25/Sep/2008 17:57:50] "POST /RPC2 HTTP/1.0" 200 - > > > Is there a way to turn this logging off? I have RTFM and can't > > seem to find a way to do so. > > > Many TIA! > > Mark > > > -- > > Mark Harrison > > Pixar Animation Studios > > Im pretty sure there's a more pythonic way, but you could redirect > stdout to /dev/null > > import sys > sys.stdout = open("/dev/null", 'w') > > assuming you're not on windows... > > ~Sean
Here's the more pythonic version: # Fake a file handle with the write method class NullDevice(object): def write(self, s): pass import sys sys.stdout = NullDevice() * http://code.activestate.com/recipes/278731/ Comment 1: attributed to Mr. Lundh ~Sean -- http://mail.python.org/mailman/listinfo/python-list