Skip to content

Instantly share code, notes, and snippets.

@DrPsychick
Last active May 2, 2020 21:02
Show Gist options
  • Save DrPsychick/cfaf174a4260a6466a7bf172c6cd8645 to your computer and use it in GitHub Desktop.
Save DrPsychick/cfaf174a4260a6466a7bf172c6cd8645 to your computer and use it in GitHub Desktop.
Medium code
import sys
import os
import fortune
from pyfiglet import Figlet
def main():
f = Figlet()
# take text from command line or env
text = " ".join(sys.argv[1:])
if (text == ""):
text = os.getenv("ASCII_TEXT")
if (text == None):
text = fortune.get_random_fortune("/fortunes")
print(f.renderText(text))
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment