Created
September 25, 2018 04:31
-
-
Save KingDarBoja/a8fc9fe63e0f4f4a4aa5290658d2c961 to your computer and use it in GitHub Desktop.
Custom hello world program with colorfull words in the terminal using colorama module.
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
"""Custom hello world by KingDarBoja. | |
Python script to output the classic 'hello world' message using colorama. | |
To install it, use 'pip install colorama' on the command line. | |
""" | |
# Import the colorama module | |
from random import randint | |
from colorama import init, Fore | |
init() | |
# Print 'hello world' in a colorful way. | |
words = 'hello world' | |
colors_list = [a for a in dir(Fore) if not a.startswith('__')] | |
for word in words: | |
print(getattr(Fore, colors_list[randint(0, len(colors_list)-1)]) + word, | |
end="") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment