Questions tagged [curses]

Curses is a library for unix-ish computers that you can use to have better and more interactive consoles, including colors. It is used in some console games, like the original Rogue.

Curses is a library for unix-ish computers that you can use to have better and more interactive consoles, including colors. It is used in some console games, like the original Rogue.

See also: -

1003 questions
20
votes
1 answer

How to create a menu and submenus in Python curses?

AFAIK, there is no curses menu extension available in Python yet so you have to roll your own solution. I know about this patch http://bugs.python.org/issue1723038 but I don't what's the current state of it. I found a nice class for Python that…
user1042840
  • 1,925
  • 2
  • 16
  • 32
16
votes
5 answers

Python curses Redirection is not supported

I am trying to use Curses in PyDev in Eclipse in Win7. I have installed Python 3.2 (64bit) and curses-2.2.win-amd64-py3.2. When I input the following testing codes into PyDev: import curses myscreen =…
shaosh
  • 657
  • 2
  • 8
  • 30
15
votes
3 answers

Is there a way to interactively program a Python curses application?

Is there a way to create a second terminal so that all calls to curses functions operate on that, rather than in the existing terminal? I work much faster when I can try things out interactively, so I'd like to be able to run an interactive python…
dan
  • 355
  • 1
  • 7
15
votes
4 answers

Interrupt (n)curses getch on incoming signal

One of my programs uses ncurses for drawing a small tui. One of my goals is to make it rather portable to other curses implementations. This means that I want to catch a SIGWINCH issued by the terminal emulator on a resize operation myself and…
user1678062
  • 573
  • 5
  • 16
15
votes
3 answers

How to install curses.h header file(or the package including it)in Linux?

I want to use certain operations (like clearing the screen etc.) in C programs in Linux platform and I am informed that it can be done including curses.h header-file. But this doesn't seem to be available along with gcc package. Please, tell me how…
Snehasish Karmakar
  • 686
  • 1
  • 6
  • 15
15
votes
2 answers

Python: curses key codes to readable (vim-like?) syntax

I want to provide keybindings in a curses-based python program. The ideal solution would be to have an abstraction layer around getch() that yields readable strings, maybe in a vim-like format. In pythonese: def get_keycomb(wind): string =…
salezica
  • 74,081
  • 25
  • 105
  • 166
14
votes
4 answers

How do I use getch from curses without clearing the screen?

I'm learning to program in C and want to be able to type characters into the terminal while my code is running without pressing return. My program works, however when I call initscr(), the screen is cleared - even after calling filter(). The…
Chris R
  • 187
  • 1
  • 1
  • 7
14
votes
1 answer

Not able to compile with curses on gcc (OS X))

I wrote a hello world program to see how curses library works. Here is my program: /Users/snihalani/dev/daas at 10:10AM ➜ cat main.c #include #include #include int main(void) { int returnValue = 0; …
SurenNihalani
  • 1,398
  • 2
  • 15
  • 28
14
votes
4 answers

Using ncurses to capture mouse clicks on a console application

I'm making a console application for unix platforms, and I'm using the curses (or ncurses) library to handle keyboard and mouse input. The problem is that I've found very little documentation on how exactly to use it for that, appart from this page…
Pedro Cori
  • 2,046
  • 2
  • 16
  • 23
13
votes
3 answers

How to manage logging in curses

I created a simple UI for my application using curses and I also include logs (logging) in my modules using herarchy structure (logmain, logmain.child1) and so on. In case an log event occurs the log is displayed in my UI,distroying its apparence. I…
Oscar Effe
  • 305
  • 2
  • 8
13
votes
2 answers

Curses returning AttributeError: 'module' object has no attribute 'initscr'

I am following the Curses programming HowTo on the Python site, but I am running into a rather bizarre issue. My code is currently very short, doesn't actually do anything because of this error, I haven't been able to move on. Here's my code: import…
RPiAwesomeness
  • 5,009
  • 10
  • 34
  • 52
12
votes
5 answers

Python curses dilemma

I'm playing around a little with Python and curses. When I run import time import curses def main(): curses.initscr() curses.cbreak() for i in range(3): time.sleep(1) curses.flash() pass print( "Hello World"…
math4tots
  • 8,540
  • 14
  • 58
  • 95
12
votes
2 answers

Is it possible to get the default background color using curses in python?

Using curses in python you can easily use the default color scheme for the terminal using: curses.use_default_colors() However once you try to recolor any character, using a color pair you have to declare a background color: curses.init_pair(1,…
Wheat Wizard
  • 3,982
  • 14
  • 34
12
votes
1 answer

Make curses program output persist in terminal scrollback history after program exits

I'm quite new to curses, so I'm trying out some different things in python. I've initialized the window and set scrollok for the window object. I can add strings, and the scrolling works so that addstr() doesn't have any errors at the end of the…
Wade
  • 3,585
  • 2
  • 22
  • 27
11
votes
7 answers

Curses library not found

I'm trying to build 5.6.4-labs-innodb-memcached, but having this issue: # cmake ./ -- MySQL 5.6.4-labs-innodb-memcached -- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH) CMake Error at cmake/readline.cmake:83 (MESSAGE): …
Roman Newaza
  • 11,405
  • 11
  • 58
  • 89
1
2
3
66 67