Questions tagged [python-curses]

The Python curses module provides an interface to the curses library, the de-facto standard for portable advanced terminal handling.

The Python curses module provides an interface to the curses library, the de-facto standard for portable advanced terminal handling.

https://docs.python.org/2/library/curses.html

271 questions
0
votes
1 answer

Python / Curses - How to print separate items?

this code the result screen: foobar (OK) stdscr.addstr(10, 10, "foobar") this code the result screen: foobar (OK) stdscr.addstr(10, 10, "foobar", curses.A_REVERSE) But how to get the result screen foobar ? Please consult anyone? Thank you.
Ing Dedek
  • 153
  • 2
  • 7
0
votes
1 answer

rxvt ignoring DECCKM sequence

I'm writing a CLI server. In my project I do the following (simplification): curses.setupterm("rxvt") smkx = curses.tigetstr("smkx") write_to_terminal_client(smkx) The detected smkx sequence is only "\E=" which matches the "infocmp rxvt" (a poor…
Marcin
  • 897
  • 1
  • 7
  • 19
0
votes
2 answers

python curses remote debugging pdevd error in setupterm

Is it possible to debug a curse program remotely in PyCharm? How to set it up? I followed the PyCharm 4.0.8 instruction, added this to the "EXAMPLE.py" from "npyscreen-4.8.7". import pydevd pydevd.settrace('localhost', port=8899,…
minghua
  • 5,981
  • 6
  • 45
  • 71
0
votes
1 answer

How to output text in python curses window with number of rows more than permissible values?

I want to display certain rows as output in my python curses window but number of rows are more than total number of lines permissible in curses window hence I am getting an error. How do I display all the contents by scrolling down to next screen.…
0
votes
1 answer

Dump curses window output to a file in python

I am trying to dump the output of curses window into a file without displaying it on stdout. Currently I am using addstr() function to print on stdout and at the end I am calling instr() function to dump the entire screen into a file. In certain…
rakesh
  • 135
  • 3
  • 15
0
votes
1 answer

lightdm startup script to change locale on raspberry pi with curses

I've written a script that uses python curses to allow me to change the locale (edits /etc/default/locale) on the raspberry pi. It has a basic menu that allows me to select the language. I want to run this script before the lxde session starts. I've…
0
votes
1 answer

Try-Except-Pass: writing in the right-lower does not fail the way I expect it to do

Using curses module for python I know that writing in the lower-right corner raise an error (something to do with the cursor having no "next place" to go to). But I do not care; all I wanted is to write a character when possible otherwise no big…
mr caca
  • 15
  • 4
0
votes
1 answer

Python Curses showing segmentation fault

Im trying to create a pad which a bunch of text in it that ill then look to scroll through. However I just get a segmentation fault ? import curses,sys from curses import wrapper import random,string def main(stdscr): pad = curses.newpad(100,…
felix001
  • 15,341
  • 32
  • 94
  • 121
0
votes
1 answer

python curses reads from window but when I try to display whats read its garbled

The program I'm trying to write prints 'Hello World' into the window. When Hello World is clicked with the mouse it reads Hello World character by character The cursor is then moved further down the screen and should display what it has read. What…
Laurence
  • 869
  • 3
  • 12
  • 20
0
votes
1 answer

How do I show a statement repeatedly on the command line using curses?

I'm struggling a little with curses module in Python. I'm trying to get it to show this constantly updating statement (in a loop): print(i/(time.time()-start_time)) on one line rather than multiple lines. What's the easiest way?
cjm2671
  • 18,348
  • 31
  • 102
  • 161
0
votes
2 answers

How can I make sure that my Dialog.progressbox() continuously gives output?

pythondialog is a module that enables you to print information in a ncurses-like interface. I want to use the Dialog.progressbox() method to print output from a subprocess.Popen() command. The problem I'm facing is that progressbox() will only print…
Exeleration-G
  • 1,360
  • 16
  • 29
0
votes
1 answer

Input limit on python curses getstr?

Afternoon, I'm attempting to use curses, and one of my requirements for this script is to accept large amounts of data. The data is meant to be pasted in, and while usually is only a few thousand lines, it could easily grow to tens of thousands. My…
Justin Popa
  • 95
  • 1
  • 7
0
votes
1 answer

Python curses prints two characters when adding a utf-8 encoded string

I have come across a very weird problem when trying to print UTF-8 encoded strings to a curses window. Here's the code, I'll talk about the exact problem and the things I have tried below. # coding=UTF-8 import curses import locale import…
0
votes
1 answer

Key event printing in a terminal using `curses`

I would like to dynamically print text in the terminal using curses but the following code doesn't display the key up/down text when this kind of key is pressed, whereas the loop text is updated. What have I done wrong ? I'm on a Mac OS…
user1054158
0
votes
1 answer

How do I print one word at a time in python shell?

I already have code for performing this task, but I can only perform this in the command prompt. The number you put into the function is words per minute, so if you input 60, you will get 60 wpm, or one word per second. import sys import time data…
edboysega321
  • 37
  • 1
  • 7