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

225 questions
3
votes
1 answer

I need an example of overlapping curses windows using panels in python

I'm looking for an example on how to use curses.panel to maintain overlapping windows.
Mark Lakata
  • 18,024
  • 5
  • 88
  • 112
2
votes
1 answer

Write output in same line, clearing previous line completely on python console

This code demonstrate a progress and print Done... at same console line and exit the program import time filename = 'file-name.txt' for i in range(0, 101): time.sleep(0.1) print('Downloading File %s [%d%%]\r'% (filename, i), end="",…
2
votes
1 answer

Python curses getch() always returns -1 if data is piped to my program

I want to read data piped into my program and then take a user input using curses. I have the following code: import curses import sys import select def read_piped_data(): data = "" while(sys.stdin in…
APN
  • 31
  • 4
2
votes
1 answer

Python3 curses with threading

I have an application using curses and threading, that waits for input, then posts it to a queue. The screen very quickly becomes corrupted with odd characters. Initially I tried adding 'with threading.Lock()' to everything that relates to curses to…
stderr
  • 43
  • 4
2
votes
1 answer

Use utf-8 character for curses border

I can't use █ character for curses border with. Code example: import curses stdscr = curses.initscr() c = '█' stdscr.border(c, c, c, c, c, c, c, c) stdscr.getch() I obtain this error: OverflowError: byte doesn't fit in chtype I can however use…
2
votes
0 answers

Python3.6 No module named '_curses'

I'm running Ubuntu 14.04 and just installed Python3.6 manually (downloading the tar file). I already have Python2.7 and Python3.4 with Python2.7 the default one. With Python3.6, everything seems to be OK except when I run import curses Traceback…
Amin
  • 33
  • 5
2
votes
2 answers

N-curses within Python : how to catch and print non ascii character?

I want to make a small program with ncurses/python and to be able to use/type in french and japanese. I understand that I should set the locale and use unicode standard. But how to deal with the result from screen.getch() ? I would like to display…
2
votes
1 answer

how to enable mouse movement events in python-curses

I want to detect mouse movement events with python-curses. I don't know how to enable these events. I tried to enable all mouse-events as follows: stdscr = curses.initscr() curses.mousemask(curses.REPORT_MOUSE_POSITION |…
Rolf
  • 44
  • 5
2
votes
1 answer

Need help to install curses for python 3.x with pycharm

Im trying to install curses for windows python 3.x with pycharm. i installed windows curses via pip. but if i import it, theres just message saying no module found. In terminal/cmd python -m pip install windows-curses Requirement already…
hyasd
  • 23
  • 3
2
votes
1 answer

How can I get curses installed for CentOS 6.10 with Python3.6.4?

I have a CentOS 6.10 installation where I have done an alternate install of Python 3.6.4. When I activate the virtual environment and attempt to run my program, I receive the following error on attempting to import curses: File…
Ramrod
  • 336
  • 5
  • 18
2
votes
1 answer

Python Curses Refreshing Text With a Loop

I'm connecting via Linux Mint's Xfce terminal ssh (also tried ssh -t) to a Raspberry Pi running Rasperian Stretch. On the Pi I have a Python-Curses example which I modified trying to get the current time to update every few seconds "in place" over…
user1325143
  • 203
  • 1
  • 4
  • 15
2
votes
2 answers

RPi - Python Curses program running at boot does not have keyboard focus

I am trying to write a program that will run when my raspberry pi starts up and will allow me to immediately begin typing things with my keyboard and have it be picked up by the program. I don't want to have to manually start the program when the pi…
chill389cc
  • 31
  • 7
2
votes
0 answers

Curses horizontal printing

Hello I am trying to use the curses library in python 3.5.2. My OS is Ubuntu 16.04. When I initialize the library, My terminal begins moving horizontally every time I hit enter. If anyone has any advice or things i can try, I would greatly…
2
votes
0 answers

How to print() and input() simultaneously to a single console without interrupting each other?

I have two threads one logging out to the console information at a specific interval and one taking in user input from the same console both on an infinite while loop from threading import Thread import time WHITE = '\033[97m' # User Input…
2
votes
0 answers

Displaying Unicode properly in curses

I want to draw a graphic using block characters using the Python 3.6 curses module. However, when I try to show a string like: screen = curses.addstr(2,2,'▄ •▄ ▄▄▄▄· ▄▄▌ ·▄▄▄▄ .▄▄▄ ▄• ') it does not display properly and instead…
Keinga
  • 41
  • 5
1 2
3
14 15