Last active
May 2, 2020 21:02
-
-
Save DrPsychick/cfaf174a4260a6466a7bf172c6cd8645 to your computer and use it in GitHub Desktop.
Medium code
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
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