So glad you're enjoying Blessings! I've had fun writing it.
I'd love to hear what kind of projects other folks are doing with it. Any neat hacks? One of my fun little demos is this terminal-dwelling Game of Life: http://pypi.python.org/pypi/conway/. I was thinking of adding an interactive mode so you can draw your own patterns and set them free; it would be an excuse to add key trapping to Blessings.
While on the subject of Django, here's a little shim to let you write lightweight management subcommands (and generate commands at runtime, if you want to go crazy):
http://pypi.python.org/pypi/django-subcommander/
Not only does this seem like an excellent replacement for curses, this overview/readme is a really great example of exactly how to detail a library/component's capabilities and how to use them. I've bookmarked this to use as a reference when writing my own documentation.
> Blessings provides just one top-level object: Terminal. Instantiating a Terminal figures out whether you're on a terminal at all and, if so, does any necessary terminal setup.
Why doesn't the module figure this out at import? Since there is a single terminal (at least right now), I don't see the point of having to instantiate a class. All that stuff could be provided directly by the module. Or if there's the possibility of controlling 2 terminals simultaneously, do something similar with the random module. Provide both functions and a class that can be instantiated if needed.
Deferring the setup is first a matter of politeness, an artifact of my opinion that importing a module shouldn't have (possibly surprising) side effects on the environment.
As for hanging everything off the Terminal instance, the motivation is that there's significant state on it that you might want to customize. Things like type (ANSI, vt100, etc.) and whether to suppress or force styling affect the result of formatting methods. See http://packages.python.org/blessings/#blessings.Terminal.__i.... I've several times benefitted by making a formatting-suppressed Terminal and passing it around.
I fully endorse you saying...
term = Terminal()
...at the top level of some module and referencing it there. Then you get the init-on-import behavior you want, but it's not forced on anybody who'd rather not have it.
Looking forward to try this out for a terminal based streaming-data feed rendering library for columnar data. The curses module in python has been ... interesting ... so any alternative is welcome.
I just experimented a bit with Blessings and I love it! I have used some urwid for terminal projects, but for the next one I'll consider Blessings as well.
Also I can't believe how few lines of code it is...
this is great. i always felt that the most common webpages we visit would be great if they were to be rendered in terminal in text only; hackernews,reddit,news,mail etc.
I'd love to hear what kind of projects other folks are doing with it. Any neat hacks? One of my fun little demos is this terminal-dwelling Game of Life: http://pypi.python.org/pypi/conway/. I was thinking of adding an interactive mode so you can draw your own patterns and set them free; it would be an excuse to add key trapping to Blessings.