This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get a random line from the Zen of Python without a print (preferably for a colorful cow to chant!) | |
# Replace stdout by an anonymous class that returns nothing on write() | |
import sys | |
stdout = sys.stdout | |
sys.stdout = type('BlackHole', (), {'write': (lambda self, string: '')})() | |
# This import's output has now been supressed | |
import this |