Python | Animated Banner showing ‘GeeksForGeeks’
Want to be fancy and create an animated banner? This program is going to print a cool animated banner to the Python console. Initially, it is suitable just for showing ‘GeeksForGeeks’. Consider it as a challenge by adding more characters yourself.
IMPORTANT NOTE:- For this to work, you have to open the file in the console, and not through the editor/IDLE.
Python implementation:
import os import time #You can change the width of the display according to your wish. WIDTH = 250 # Written below currently is GeeksForGeeks. If you wish to get more # written, you have to add each alphabet manually. message = "geeksforgeeks".upper() #The message will get printed here. printedMessage = [ "","","","","","","","","","","","","","", ] """ What we have done here is a dictionary mapping the letters to their line. These mapped indexes identify itself to each letter in the dictionary and also for each line in the display. """characters = { " " : [ " ", " ", " ", " ", " ", " ", " " ], "E" : [ "*****", "* ", "* ", "*****", "* ", "* ", "*****" ], "O" : [ "*****", "* *", "* *", "* *", "* *", "* *", "*****" ], "K" : [ " * *", " * * ", " * * ", " ** ", " * * ", " * * ", " * *" ], "S" : [" **** ", " * ", " * ", " *** ", " * ", " * ", " **** " ], "G" : [" *** ", "* * ", "* ", "* *** ", "* * ", "* * ", " *** " ], "F" : ["***** ", "* ", "* ", "**** ", "* ", "* ", "* " ], "R" : [" **** ", " * * ", " * * ", " **** ", " * * ", " * * ", " * * " ] } for row in range(7): for char in message: printedMessage[row] += (str(characters[char][row]) + " ") offset = WIDTH while True: os.system("cls") for row in range(7): print(" " * offset + printedMessage[row][max(0,offset*-1):WIDTH - offset]) offset -=1 if offset <= ((len(message)+2)*6) * -1: offset = WIDTH #Use this to change the speed of the animation that you wish to keep. time.sleep(0.10) |
Output (The original output will be moving from right to left. Basically, it’s an animation.):

Recommended Posts:
- Python | Merge Python key values to list
- Important differences between Python 2.x and Python 3.x with examples
- Reading Python File-Like Objects from C | Python
- Python | Add Logging to Python Libraries
- Python | Add Logging to a Python Script
- Python | Set 4 (Dictionary, Keywords in Python)
- Python | Sort Python Dictionaries by Key or Value
- JavaScript vs Python : Can Python Overtop JavaScript by 2020?
- bin() in Python
- max() and min() in Python
- SHA in Python
- Any & All in Python
- Use of min() and max() in Python
- chr() in Python
- zip() in Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



