Skip to content

Instantly share code, notes, and snippets.

View danmaps's full-sized avatar
🏠
Working from home

Danny McVey danmaps

🏠
Working from home
  • SCE
  • Redlands, CA
View GitHub Profile
@danmaps
danmaps / cowzen.py
Created August 30, 2019 22:44 — forked from AgustinLado/cowzen.py
Get a random line from the Zen of Python without a print (preferably for a colorful cow to chant!)
# 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