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 issue with curses.intscr()

I am new in Python and I am using curses for my script. But when I am try to run the script in server(let say 1) I am getting below error. _curses.error: addstr() returned ERR And the same script when I am try to run in another server(let say 2) it…
user2510115
  • 674
  • 2
  • 8
  • 17
0
votes
1 answer

How to make PyQt App give up window focus?

I have a python command line script that starts a PyQt Application showing the input of the video device in a little window. Then it starts a curses screen so that the user can control the camera with the keyboard. After starting the script, the…
Suzana
  • 4,251
  • 2
  • 28
  • 52
0
votes
0 answers

Error with Curses on Raspberry Pi - Python

I've recently bought a Raspberry Pi and I'm completely new to Linux and Python. I'm trying to build a program that will enable to control the frequency of a flashing light with the arrow keys. So I found a related question with a solution here. I've…
user26830
  • 1,059
  • 4
  • 16
  • 25
0
votes
1 answer

curses.echo() stopped working in curses after window became pad

In an earlier version of this program echo() worked fine but stopped working after some rewrites. The only thing i can think of that could be relevant is that the main window (self.screen) is now a pad instead of stdscr. Everything else is working…
sousys
  • 51
  • 6
0
votes
2 answers

Weird error with .addstr() in a derwin()-object in Python Curses

I'm trying to segment one window in curses into several sub-windows (with derwin()). The code creates two sub-windows and I can add a string; no problem with the first function. The second one is pretty much exactly the same but gives me an error…
sousys
  • 51
  • 6
0
votes
1 answer

enter sessible user input box

I am trying to create a input box as shown below. For this reason, I have wrote below code but whenever I press enter key, it should not take any word, lke whenever you press enter key on the username input box it will swtich to the password input…
demilg
  • 77
  • 6
-1
votes
1 answer

Why is junk data appearing in my Python's subprocess stdout?

I'm writing a Python app that runs a command on an AWS remote docker container, and saves the output to a file. The command that is being run remotely is generating binary data (a database dump). The app works great if I start the download and don't…
John
  • 2,551
  • 3
  • 30
  • 55
-1
votes
2 answers

ModuleNotFoundError: when importing curses in IDE

I get the error ModuleNotFoundError: No module named '_curses' every time I try to uses curses in VS Code or PyCharm. But it works in the command prompt (I'm on Windows BTW) Code is from Tech With Tim tutorial: import curses from curses import…
Luke
  • 1
-1
votes
1 answer

not able to append in a list in curses module?

I want to take a user input with python curses module but every time it is not adding any element in the list can any one please help me my code :- import curses from curses import wrapper from curses.textpad import Textbox, rectangle tempo_list =…
-1
votes
1 answer

Enter key not recognized with curses

I have this sample code where I write on the screen if the enter key is pressed but when I run the code nothing happens and nothing is written on the screen. I know I can use stdscr.getch(), but for some reason I don't want to use them. import…
Amey patil
  • 25
  • 1
  • 4
-1
votes
1 answer

curses: Straight line with last color at the bottom of the window in windows cmd

problem When I run a curses program via windows cmd.exe that outputs colored text I get an unselectable line on the bottom of the window. How can I remove it? example import curses def main(stdscr): curses.init_pair(1, 200, 100) …
rafalou38
  • 576
  • 1
  • 5
  • 16
-1
votes
1 answer

User interface in Python

I was looking up on how to write a (relatively) friendly user interface in Python for a program of mine, and as I understood I need a module called "curses". I tried to install it via the pip method, but the shell says that no matching distibution…
Michele Bastione
  • 363
  • 3
  • 13
-1
votes
2 answers

Function in a box curses

there. Can anyone tell me what I did wrong in the code? Why the timer function doesn't appear in the box? import curses from datetime import datetime stdsrc= curses.initscr() SPACE_KEY = ord(' ') box1 = curses.newwin(20, 30, 10, 10) box1.box() …
user7519
  • 17
  • 2
-1
votes
1 answer

How can I escape sub-window with or without any input string in python curses?

In python curses, if I draw a sub-window using scr.subwin() to get input with getstr() function as below search_box = screen.subwin(3, 30, 20, 30) search_box.clear() search_box.box() search_box.addstr(1, 1,…
Manu
  • 325
  • 1
  • 4
  • 10
-1
votes
1 answer

How should I be going about exiting python script when user types 'q'?

I'm trying to add code to exit my curses python script correctly when the user types q. I can't merely do CTRL+C because then curses won't be de-initialized correctly. I haven't found a good solution with getting user input that has a timeout so the…
minnymauer
  • 374
  • 1
  • 4
  • 17
1 2 3
18
19