Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pokedex.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,18 @@ def display_pokemon_info(data, show_abilities=False, show_size=False):
and weight (in kilograms) will be printed.
Defaults to False.
"""
width = 40 # you can tweak this for aesthetics
header_title = "POKÉDEX DATA"
footer_title = "End of Pokédex Entry"

def print_box(title):
print("╔" + "═" * (width - 2) + "╗")
print("║{:^{width}}║".format(title, width=width - 2))
print("╚" + "═" * (width - 2) + "╝")

# Print Header
print_box(header_title)

print(f"\n{Fore.GREEN}--- {data['name'].title()} ---{Style.RESET_ALL}")
print(f" {Fore.CYAN}National Pokédex Number: {data['id']}{Style.RESET_ALL}")

Expand Down Expand Up @@ -209,6 +221,8 @@ def display_pokemon_info(data, show_abilities=False, show_size=False):
print(f" Weight: {weight_kg} kg")
print(f"\n{Fore.GREEN}------------------{Style.RESET_ALL}")

# Print Footer
print_box(footer_title)

def main():
"""
Expand Down