curses

Windows Curses Adding Weird Spacing

Windows Curses Adding Weird Spacing Question: I have some python code that uses curses to continuously print "Test Bot." And allowing me to send messages at the same time now its printing "Test Bot." fine but when I try to enter "Test User." there is some weird spacing before it Here’s the code: import curses, …

Total answers: 1

After installing windows_curse, it shows ImportError: cannot import name 'resizeterm' from 'curses'

After installing windows_curse, it shows ImportError: cannot import name 'resizeterm' from 'curses' Question: I am testing pv3d and have downloaded packages already. In testing, I’ve downloaded it using pip install windows_curses, but it displayed ImportError: cannot import name ‘resizeterm’ from ‘curses’ when I was running from curses import resizeterm, what should I do to solve …

Total answers: 1

ModuleNotFoundError: No module named '_curses' on Ubuntu 22.04

ModuleNotFoundError: No module named '_curses' on Ubuntu 22.04 Question: I want to use curses for a personnal Python project. However, when I try to import it, I get the following error : >>> import curses Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/xxxxxx/.asdf/installs/python/3.9.13/lib/python3.9/curses/__init__.py", line 13, in <module> from _curses import …

Total answers: 1

Python curses, splitting terminal window in 4 pads – prefresh() returned ERR

Python curses, splitting terminal window in 4 pads – prefresh() returned ERR Question: I’m running a multiprocessing system in Python, and I was planning to use curses to divide the terminal window in 4 quadrants, and display the output of each of the processes in one of them. So, the final output should look something …

Total answers: 1

Python curses how to change cursor position with curses.setsyx(y,x)?

Python curses how to change cursor position with curses.setsyx(y,x)? Question: I am learning how to use curses and I am trying to create a simple program to start off. I am expecting this program to have a q printed in the top left corner always, then it prints the most recently pressed character in 1,1. …

Total answers: 3

How to display pre-colored string with curses?

How to display pre-colored string with curses? Question: I’m writing a curses program in Python. I’m a beginner of curses but I’ve used terminal control sequences for colored output. Now there’s some code snippets to print inside the window, I’d like them be syntax highlighted, and it’s better done with libraries like pygments, which outputs …

Total answers: 3

How to use terminal color palette with curses

How to use terminal color palette with curses Question: I can’t get the terminal color palette to work with curses. import curses def main(stdscr): curses.use_default_colors() for i in range(0,7): stdscr.addstr(“Hello”, curses.color_pair(i)) stdscr.getch() curses.wrapper(main) This python script yields the following screen: However, I do have more colors in my gnome-terminal palette. How can I access them …

Total answers: 7

Curses alternative for windows

Curses alternative for windows Question: Is there any alternative of the curses module for python to use in windows? I looked up in the python documentation, but there its mentioned that its for using in unix. I am not much familiar with these, so is there some way to use curses module in windows or …

Total answers: 7

Python Curses Handling Window (Terminal) Resize

Python Curses Handling Window (Terminal) Resize Question: This is two questions really: how do I resize a curses window, and how do I deal with a terminal resize in curses? Is it possible to know when a window has changed size? I really can’t find any good doc, not even covered on http://docs.python.org/library/curses.html Asked By: …

Total answers: 5