curses

CMake can't find Curses

孤人 提交于 2020-01-12 13:44:14
问题 I am trying to compile the openlase library from www.marcansoft.com and have been running into problems with CMake. CMake is returning an error stating that it cannot find Curses, and after a lot of looking I am still stumped as to what the issue is. I have checked that I have the various ncurses packages installed but still the error persists. Im not very familiar with CMake but I was able to resolve other dependency issues that arose before this one. The following is the output in terminal.

ImportError: No module named '_curses' when trying to import blessings

ぐ巨炮叔叔 提交于 2020-01-12 04:20:09
问题 I am trying to run this: from blessings import Terminal t = Terminal() print (t.bold('Hi there!')) print (t.bold_red_on_bright_green('It hurts my eyes!')) with t.location(0, t.height - 1): print ('This is at the bottom.') Which is the first example here: https://pypi.python.org/pypi/blessings. However, I get this error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\�����\AppData\Local\Programs\Python\Python35- 32\lib\site-packages\blessings\__init__.py"

Attribute BOLD doesn't seem to work in my curses

牧云@^-^@ 提交于 2020-01-10 05:12:22
问题 I use something like this: screen.addstr(text, color_pair(1) | A_BOLD), but it doesn't seem to work.. However, A_REVERSE and all others attribute does work! In fact, I'm trying to print something in white, but the COLOR_WHITE prints it gray.. and after a while of searching, it seems that printing it gray + BOLD makes it! Any helps would be greatly appreciated. 回答1: Here's an example code (Python 2.6, Linux): #!/usr/bin/env python from itertools import cycle import curses, contextlib, time

Ncurses limited output size

心不动则不痛 提交于 2020-01-06 17:59:32
问题 I'm learning how to use ncurses and I'm in a weird situation. It seems my output can't go over 24 lines. Moreover, whenever I run my software, and the execution finishes his job, my terminal stops working as before, and I have 2 different situations: if I've launched my run from a line behind line 24 I can use the terminal, but if I keep scrolling when at the last line of the window, nothing more happens: all input and output keep happening in the last line, without any new line appearing at

Scheduling function calls in a Python curses UI

北城以北 提交于 2020-01-06 05:06:07
问题 I'm trying to write a program that will have a curses interface (so I can easily change settings on the fly) and will also be able to call and display the output of functions called on different schedules. I can't figure out how to efficiently call something on a set time period and still use a curses loop that can take input at any time. Here's an example of a small program that attempts to do what I'm saying. (doesn't work) import curses, sched, time from datetime import datetime def show

ncurses: init_color() has no effect

徘徊边缘 提交于 2020-01-05 11:47:59
问题 Trying to define color pairs, I was getting strange results. All 256 colors are already defined, and attempt to change any color with init_color() has no affect. I'm using Putty with 256-colors enabled and TERM=xterm-256color (also putty-256color), ncurses 6.0 compiled with --enable-widec and --enable-ext-colors. This shows all colors are defined and the init_color() doesn't change anything even though it succeeds: init_scr(); start_color(); if (has_colors() && COLORS == 256 && can_change

PDCurses resize_term arbitrarily fails or succeeds

℡╲_俬逩灬. 提交于 2020-01-05 04:31:08
问题 I'm trying to resize the terminal window I've been printing in with PDCurses. It only works sometimes. Otherwise it just sets itself to the default size, not even returning an error. Examples of sizes that work: resize_term(50, 50); resize_term(100, 100); resize_term(51, 100); resize_term(50, 51); resize_term(2, 60); Examples of sizes that don't work: resize_term(51, 51); resize_term(51, 50); resize_term(100, 51); resize_term(60, 2); Does anyone know why these certain ranges of sizes don't

Interrupt (n)curses getch on incoming signal

╄→尐↘猪︶ㄣ 提交于 2020-01-02 00:54:11
问题 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 update my tui to adhere the changed geometry (and not depend on the resizing facilities of ncurses). Since POSIX (as far as I know) only allows access to sig_atomic_t variables within the signal handler, I set one to a different state. In the main loop,

scroll page by page or line by line using python curses

一笑奈何 提交于 2019-12-31 04:42:28
问题 Using python curses I am trying to write some text in to window. But when I reach end of window i get addstr() returned ERR how to scroll the output page by page or line by line.? how can I bind SPACE key or down arrow ? here is my code: try: screen = curses.initscr() screen.immedok(True) curses.start_color() curses.init_pair(1, curses.COLOR_GREEN, curses.COLOR_BLACK) curses.init_pair(2, curses.COLOR_WHITE, curses.COLOR_BLACK) screen.bkgd(curses.color_pair(2)) screen.scrollok(1) screen.border

Workaround for ncurses multi-thread read and write

牧云@^-^@ 提交于 2019-12-29 08:21:52
问题 This is what says on http://invisible-island.net/ncurses/ncurses.faq.html#multithread If you have a program which uses curses in more than one thread, you will almost certainly see odd behavior. That is because curses relies upon static variables for both input and output. Using one thread for input and other(s) for output cannot solve the problem, nor can extra screen updates help. This FAQ is not a tutorial on threaded programming. Specifically, it mentions it is not safe even if input and