harry potter theme linux in python

To create a Harry Potter theme in Linux using Python, we can use the "curses" library. "curses" allows us to create colorful and interactive terminal UI. Here's a code snippet to get you started:

main.py
import curses

def main(stdscr):
    # Clear screen
    stdscr.clear()

    # Turn on attributes for bold text
    curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLACK)
    stdscr.attron(curses.color_pair(1) | curses.A_BOLD)

    # Print Hogwarts crest
    stdscr.addstr("           ██████╗ ██╗   ██╗██████╗      ██╗████████╗     \n")
    stdscr.addstr("          ██╔════╝ ██║   ██║██╔══██╗     ██║╚══██╔══╝     \n")
    stdscr.addstr("          ██║  ███╗██║   ██║██║  ██║     ██║   ██║        \n")
    stdscr.addstr("          ██║   ██║██║   ██║██║  ██║     ██║   ██║        \n")
    stdscr.addstr("          ╚██████╔╝╚██████╔╝██████╔╝     ██║   ██║        \n")
    stdscr.addstr("           ╚═════╝  ╚═════╝ ╚═════╝      ╚═╝   ╚═╝        \n")

    # Print some Hogwarts facts
    stdscr.addstr("\n\n")
    stdscr.addstr("         Hogwarts School of Witchcraft and Wizardry        \n")
    stdscr.addstr("           is a British wizarding boarding school          \n")
    stdscr.addstr("         teaching the magical arts, located in Scotland.   \n")

    # Refresh screen
    stdscr.refresh()

    # Wait for user input to exit
    stdscr.getkey()

# Start curses program
curses.wrapper(main)
1202 chars
33 lines

This code will create a simple Harry Potter-themed terminal UI with the Hogwarts crest and some Hogwarts facts. You can customize it further by adding more text or graphics, or by changing the color scheme.

gistlibby LogSnag