python stop stdout code example Example: python stop stdout f = open('/dev/null', 'w') sys.stdout = f