Skip to content

Instantly share code, notes, and snippets.

@devforfu
Created February 16, 2019 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devforfu/cba04672d444eea26206fa45df4087f3 to your computer and use it in GitHub Desktop.
Save devforfu/cba04672d444eea26206fa45df4087f3 to your computer and use it in GitHub Desktop.
An illustration of the debugging issues when using curses
import curses
def main(term):
term.clear()
for i in range(10):
# try to debug after curses mangled the terminal
breakpoint()
term.addstr(i, 0, f'String: {i + 1:d}')
term.refresh()
term.getkey()
if __name__ == '__main__':
curses.wrapper(main)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment