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