Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import curses
- screen = curses.initscr()
- screen.addstr("Press any key...")
- screen.refresh()
- # Convert the key to ASCII and print ordinal value
- while True:
- c = screen.getch()
- print("You pressed %s which is keycode %d." % (chr(c), c))
- curses.endwin()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement