Sunday 1:50 p.m.–2:20 p.m.
- Audience level:
- Python Libraries
Have you ever wanted to add a status bar to your command line program? Or maybe color the output a bit? Or do you want to write a fullscreen terminal application like ls, top, vim, or emacs? Then you need to speak a bit of terminal! This talk describes how to talk to your terminal from scratch and goes on to show why Python libraries Blessings and Urwid are so awesome.
The terminal emulators we run so many of our programming tools in are more powerful than we remember to give them credit for, and the key to that power is understanding the interface. This talk will cover terminal colors and styles, writing to arbitrary portions of the screen, handling signals from the terminal, determining the terminal's dimensions, scrollback buffer behavior and relevant environmental variables. Terminal programming can get hairy; along the way we'll deal with encoding issues, consider cross platform concerns, acknowledge 4 decades' worth of standards for terminal communication, and consider that humans at interactive terminals may not be the only users of our interfaces. By gaining an understanding of these issues, we'll be able choose from the abstractions over them offered by Python libraries Urwid, curses, and Blessings.