Eid al-Adha is one of the most beautiful festivals celebrated by Muslims around the world. It is a festival of sacrifice, kindness, gratitude, and sharing happiness with family and friends.
As programmers, we can also celebrate festivals creatively using Python! In this project, we will create a colorful Eid al-Adha greeting program using two amazing Python libraries:
-
pyfiglet→ for stylish ASCII text -
termcolor→ for colorful terminal output
The final output displays a beautiful Eid greeting in the terminal with stylish fonts and colors.
π¦ Install Required Libraries
First, install the required libraries using pip:
pip install pyfiglet
pip install termcolor
π§ Python Code
from pyfiglet import Figlet
from termcolor import colored
def eid_al_adha_wishes():
clcoding = Figlet(font="slant")
ascii_art = clcoding.renderText("Eid al-Adha")
print(colored(ascii_art, "cyan"))
print(colored("π Eid al-Adha Mubarak π", "yellow"))
# Call the function
eid_al_adha_wishes()
π Code Explanation
1. Import Libraries
from pyfiglet import Figlet
from termcolor import colored
-
Figletcreates stylish ASCII text. -
colored()adds colors to terminal text.
2. Create Function
def eid_al_adha_wishes():
This function contains all the Eid greeting logic.
3. Select Font Style
clcoding = Figlet(font="slant")
The "slant" font creates a stylish slanted text design.
4. Convert Text into ASCII Art
ascii_art = clcoding.renderText("Eid al-Adha")
This converts the text into decorative ASCII art.
5. Print Colored Output
print(colored(ascii_art, "cyan"))
Displays the ASCII text in cyan color.
print(colored("π Eid al-Adha Mubarak π", "yellow"))
Prints the festival wish in yellow color.
π¨ Why Use ASCII Art?
ASCII art makes terminal applications:
- More attractive
- Fun to use
- Festival-themed
- Perfect for beginners learning Python creativity
π Bonus Ideas
You can improve this project by:
- Adding more colors
- Using different pyfiglet fonts
- Playing Eid music using Python
- Creating animated terminal greetings
- Adding a countdown timer for Eid
π Libraries Used
πΉ pyfiglet
Used for generating stylish text art.
πΉ termcolor
Used for adding colors to terminal text.
π‘ Final Thoughts
Python is not only for automation and data science — it can also be used for fun festival projects and creative terminal applications. Small projects like this help beginners learn Python in an enjoyable way.
π Eid al-Adha Mubarak to everyone!
May peace, happiness, and success fill your life.


0 Comments:
Post a Comment