'python code not printing the same as the tutorial i am following, key=stdscr.getkey() and print(key)

This is the same tutorial as my other post, but this time i realized my code was not printing the same thing as his around 16 mins 50 seconds. The problem is around the print(key) and key = stdscr.getkey() lines https://www.youtube.com/watch?v=NQ5i1kJAA6Y&t=105s&ab_channel=TechWithTim

import curses
from curses import wrapper

def main(stdscr):
    curses.init_pair(1, curses.COLOR_GREEN, curses.COLOR_BLACK)
    curses.init_pair(2, curses.COLOR_RED, curses.COLOR_BLACK)
    curses.init_pair(3, curses.COLOR_WHITE, curses.COLOR_BLACK)

    stdscr.clear()
    stdscr.addstr(0, 0, "Hello World!")
    stdscr.refresh()
    key = stdscr.getkey()
    print(key)
              
wrapper(main)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source