Created
May 25, 2025 07:50
-
-
Save arockwell/be8b65822ac27353ca2117ec0924efee to your computer and use it in GitHub Desktop.
Snazzy Hello World
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
#!/usr/bin/env python3 | |
""" | |
Hello World v2.0 - Now with 100% more snazz! ✨ | |
""" | |
import random | |
import time | |
from datetime import datetime | |
def typewriter_effect(text, delay=0.05): | |
"""Print text with a typewriter effect""" | |
for char in text: | |
print(char, end='', flush=True) | |
time.sleep(delay) | |
print() | |
def main(): | |
# ASCII art banner | |
banner = r""" | |
╔═══════════════════════════════════════╗ | |
║ _ _ _ _ __ __ ║ | |
║ | | | | ___| | | ___ \ \ / / ║ | |
║ | |_| |/ _ \ | |/ _ \ \ \ /\ / / ║ | |
║ | _ | __/ | | (_) | \ V V / ║ | |
║ |_| |_|\___|_|_|\___/ \_/\_/ ║ | |
║ ║ | |
║ 🌟 Version 2.0 🌟 ║ | |
╚═══════════════════════════════════════╝ | |
""" | |
greetings = [ | |
"Greetings, earthling! 👽", | |
"Ahoy there, code adventurer! ⚓", | |
"Welcome to the matrix! 💻", | |
"Beep boop, human detected! 🤖", | |
"Salutations, digital wanderer! 🌐" | |
] | |
colors = [ | |
"\033[91m", # Red | |
"\033[92m", # Green | |
"\033[94m", # Blue | |
"\033[95m", # Magenta | |
"\033[96m", # Cyan | |
] | |
reset_color = "\033[0m" | |
# Print the banner with random color | |
color = random.choice(colors) | |
print(f"{color}{banner}{reset_color}") | |
# Random greeting with typewriter effect | |
greeting = random.choice(greetings) | |
typewriter_effect(greeting) | |
# Current time greeting | |
current_hour = datetime.now().hour | |
if 5 <= current_hour < 12: | |
time_greeting = "Good morning! ☀️" | |
elif 12 <= current_hour < 18: | |
time_greeting = "Good afternoon! 🌤️" | |
elif 18 <= current_hour < 22: | |
time_greeting = "Good evening! 🌆" | |
else: | |
time_greeting = "Good night! 🌙" | |
print(f"\n{time_greeting} The time is {datetime.now().strftime('%I:%M %p')}") | |
# Fun facts | |
facts = [ | |
"Did you know? 'Hello World' was first used in 1972! 📚", | |
"Fun fact: This script contains exactly 42 lines of pure awesomeness! 🎯", | |
"Pro tip: You're awesome for running this script! 🌟", | |
"Remember: Every expert was once a beginner! 🚀", | |
"Quote: 'Hello World' - The first step of every programming journey! 👣" | |
] | |
print(f"\n{random.choice(facts)}") | |
# Animated loading bar | |
print("\nInitializing snazziness", end="") | |
for i in range(10): | |
print(".", end="", flush=True) | |
time.sleep(0.1) | |
print(" ✅") | |
# Final message | |
print(f"\n{color}╭{'─' * 50}╮{reset_color}") | |
print(f"{color}│{' ' * 15}HELLO, WORLD v2.0!{' ' * 17}│{reset_color}") | |
print(f"{color}│{' ' * 12}Now with extra pizzazz! 🎉{' ' * 11}│{reset_color}") | |
print(f"{color}╰{'─' * 50}╯{reset_color}") | |
print("\nThank you for experiencing Hello World v2.0! 🎊") | |
print("May your code be bug-free and your coffee be strong! ☕\n") | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment