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

PyCurses MousClick

self.stdscr = stdscr self.initialize(**object_dict) self.map_all_colors() self.draw_all_views() curses.curs_set(0) stdscr.keypad(1) curses.mousemask(1) curses.mousemask(curses.ALL_MOUSE_EVENTS) # Once self.interact(..) returns a value, program…
0
votes
0 answers

Python Curses Textbox does not accept non-ASCII characters

I started playing around with Curses and noticed that the textbox does not accept German umlauts. Even after following the internet’s hint to set locale the input does not work even though the characters get displayed properly when printed via…
Benito
  • 23
  • 2
  • 3
  • 9
0
votes
0 answers

Issue with Countdown Timer and User Input in Python using curses

I'm working on a Python program that involves a real-time countdown timer and allows the user to input a value inline with the timer using the curses library. However, I'm facing some issues with the code and need some assistance in fixing it. The…
0
votes
1 answer

Input & Print at the same time?(python 3.11, windows11)

Currently, the code waits for user input before printing the next number. I want the code to print numbers continuously without being interrupted by user input, but still allow the user to enter a number and have it displayed in the output. How can…
0
votes
0 answers

What should I expect Python's curses library's getch function to return for Alt+F1?

I need to accept Alt+F-key's in my application. The application needs to run on Windows and Linux. I'm using the following code to test what getch receives when I press Alt+F1: import curses def main(stdscr): while True: ch =…
FrederikVds
  • 551
  • 4
  • 11
0
votes
1 answer

Python Curses: Check if cursor is hidden

I am wanting to write a function to ask the user input using Python curses. The problem I am having is I want to have the cursor hidden in other parts of the program except in the text-box. I intend to use this function in many cases and if the…
Enderbyte09
  • 409
  • 1
  • 5
  • 11
0
votes
1 answer

python error "ModuleNotFoundError: No module named '_curses' "

import curses class TextEditor: def __init__(self): self.screen = curses.initscr() curses.noecho() curses.cbreak() self.screen.keypad(True) self.buffer = "" self.row = 0 self.col = 0 …
Songkail
  • 27
  • 2
0
votes
1 answer

Left side displacing when using Japanese characters with curses in python

This is a small python program using curses: import curses import locale def init_curses(): stdscr = curses.initscr() curses.start_color() curses.use_default_colors() curses.noecho() curses.cbreak() stdscr.keypad(True) …
0
votes
0 answers

Textbox.edit() inputs letters twice

I wrote simple function, and I can't figure out why it inputs letters twice. I was trying to change position of screen.refresh(), but the problem is, this screen isn't reloading, after choosing this function from menu. def add_dish(): …
0x0uer
  • 69
  • 4
0
votes
0 answers

Python curses how to set cursor position in a window

I have a window in a window. I wish to place the cursor within the inner-most window. I thought that window.move(y,x) would do the trick, but that seems to have no effect unless called in the outer-most window. What I want to…
Edward Falk
  • 9,991
  • 11
  • 77
  • 112
0
votes
0 answers

How can I show colored text using curses without init_pair?

I had making a program with curses. I want show colored text without curses.init_pair(). Code like this: #! /usr/bin/env python import curses def allcolors(): """Set the colors. The format is: fg*256+bg """ if curses.COLORS**2 <…
phao
  • 1
  • 6
0
votes
0 answers

Python ncurses program stops working when resizing command prompt to mininimum size

I'm currently facing a problem where my program seems to work fine when the windows cmd has a height of at least 3 rows. However when the cmd is resized smaller than that, ncurses stops updating the cmd dimensions (self.x, self.y) which breaks my…
Marco
  • 3
  • 2
0
votes
0 answers

monitor values that change in curses python

I have a mongo DB document that have a value that get updated with python script (so it change) I want to monitor this value along with lots of values that changed and get updated all the time in the terminal with curses I want to know how to view…
ms_safy
  • 1
  • 3
0
votes
1 answer

What is curses.COLORS in Python curses library?

I would like to know what curses.COLORS is in the curses module. I didn't find any explanation on what exactly it is in the documentation.
RatoGBM
  • 13
  • 2
0
votes
1 answer

Animation using pads in curses

I would like to move a curses pad across the screen, but I can't figure out a way to automatically erase the pad from the previous position in the screen without erasing the contents of the pad. I don't want to have to redraw the pad every time I…
DraftyHat
  • 428
  • 1
  • 2
  • 6