Change the future

Sunday 2:30 p.m.–3 p.m.

Use curses, don't swear

Sean Zicari

Audience level:
Intermediate
Category:
Useful Libraries

Description

I find it very handy to be able to fire up the command line and make changes through a well-designed CLI tool. I'd like to show how the 3rd party urwid library or the built-in curses library can be used to build such tools easily.

Abstract

"Dear browsers, everything you can do I can do better. Sincerely, the Command Line"

Do you find yourself using the command line all the time, even using lynx/links instead of a web browser whenever possible? Do you find yourself having to administer a website or other services through a web interface? Would you like to do even more through the command line? Do you love to program in python AND don't want to learn C? DO YOU LOVE RHETORICAL QUESTIONS?!?!

If so, then this talk is for you! I will be demonstrating how python can be used to create powerful CLI applications using either the built-in curses library or the third party urwid library.

We will go over some basic UI principles, dissect a simple program (one version written with the curses lib, one written with urwid), and we will do some quick brainstorming and write our own short program.

You can expect to walk away with a working demo program, links to more information and (hopefully) a desire to write your own CLI applications!


Detailed Outline

  1. Who am I? VERY Brief overview as relevant to the talk.

    • Who I am.
    • Where I work.
    • What technologies I like (and why I like python).
  2. Basic historical overview of curses lib.

    • Why it exists.
    • What problem(s) it solves.
    • What features it provides.
    • What can we do that we couldn't before, because of it.
    • Why am I interested in it?
  3. Some basic UI concepts/theory

    • What makes a good UI.
    • When does it make sense to create an UI for something?
    • Why choose a TUI (text-based user interface) over a web UI or other kinds of UIs?
  4. Program Dissection

    • Examine a program written with the curses lib that generates a simple TUI
      • Describe how to divide the screen up into a sensible layout.
      • Talk about handling user input and refreshing the layout programmatically.
    • Examine the same program written with urwid.
      • Discuss same points as above.
  5. Brainstorming in a problem space

    • Write an TUI for an existing API.
      • I will present (three?) options, and we will decide together which to implement.
      • Write a simple interface for the chosen API in one of the libs (maybe both - time dependent).
  6. Wrap up

    • Summary of what was covered.
    • Links to more information.