replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Python 3
Another take at The Zen of Python, inspired by Maxime's answer Maxime's answer.
import codecs
import os
import sys
import random
stdout = sys.stdout
sys.stdout = open(os.devnull, 'r+')
import this
sys.stdout.close()
sys.stdout = stdout
zen = codecs.decode(this.s, 'rot-13').splitlines()
print(random.choice(zen))
Python 3
Another take at The Zen of Python, inspired by Maxime's answer.
import codecs
import os
import sys
import random
stdout = sys.stdout
sys.stdout = open(os.devnull, 'r+')
import this
sys.stdout.close()
sys.stdout = stdout
zen = codecs.decode(this.s, 'rot-13').splitlines()
print(random.choice(zen))
Python 3
Another take at The Zen of Python, inspired by Maxime's answer.
import codecs
import os
import sys
import random
stdout = sys.stdout
sys.stdout = open(os.devnull, 'r+')
import this
sys.stdout.close()
sys.stdout = stdout
zen = codecs.decode(this.s, 'rot-13').splitlines()
print(random.choice(zen))
Python 3
Another take at The Zen of Python, inspired by Maxime's answer.
import codecs
import os
import sys
import random
stdout = sys.stdout
sys.stdout = open(os.devnull, 'r+')
import this
sys.stdout.close()
sys.stdout = stdout
zen = codecs.decode(this.s, 'rot-13').splitlines()
print(random.choice(zen))