I've been reading tutorials about Curses programming in Python, and many refer to an ability to use extended characters, such as line-drawing symbols. They're characters > 255, and the curses library knows how to display them in the current terminal font.
Some of the tutorials say you use it like this:
c = ACS_ULCORNER
...and some say you use it like this:
c = curses.ACS_ULCORNER
(That's supposed to be the upper-left corner of a box, like an L flipped vertically)
Anyway, regardless of which method I use, the name is not defined and the program thus fails. I tried "import curses" and "from curses import *", and neither works.
Curses' window() function makes use of these characters, so I even tried poking around on my box for the source to see how it does it, but I can't find it anywhere.
From curses/__init__.py
:
Some constants, most notably the
ACS_*
ones, are only added to the C_curses
module's dictionary afterinitscr()
is called. (Some versions of SGI's curses don't define values for those constants untilinitscr()
has been called.) This wrapper function calls the underlying Cinitscr()
, and then copies the constants from the_curses
module to the curses package's dictionary. Don't do 'from curses import *
' if you'll be needing theACS_*
constants.
In other words:
>>> import curses
>>> curses.ACS_ULCORNER
exception
>>> curses.initscr()
>>> curses.ACS_ULCORNER
>>> 4194412