Errors should never pass silently ... unless explicitly silenced.

Skip Montanaro skip at pobox.com
Fri Feb 7 16:26:36 CET 2003


    Michele> In Linux I am doing
    Michele>   sys.stderr=file('/dev/null','w')

    Michele> Is there a better way of doing that?

How about:

    class NUL:
        def write(self, *args):
            pass

    sys.stderr = NUL()

Skip





More information about the Python-list mailing list