Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
94 views

I've been trying to develop my own simple little CLI Typing Game with Curses. The menu works, but when I try to press play on it, the words aren't appearing. I could see them before but they're just ...
Uzi's user avatar
  • 9
1 vote
0 answers
48 views

With this example #!/usr/bin/env python3 import curses def repaint(stdscr,flog,wlog): flog.clear() wlog.clear() # It seems flog and wlog autoresizing magicaly # flog.resize(curses.LINES, ...
Jose Luis Zabalza's user avatar
1 vote
0 answers
67 views

I have an curses application with a getch() loop. I found that the application would only display after accepting user input. In other words, I could not draw anything to the terminal before ...
user1833028's user avatar
0 votes
2 answers
121 views

I'm trying to display big ascii text with curses, but it only works in the Visual Studio Code terminal for some reason. Visual Studio Code terminal displays the text correctly But when I try to run ...
Lucy's user avatar
  • 105
1 vote
1 answer
154 views

curses.KEY_ENTER and curses.KEY_BACKSPACE have values that stdscr.getch never seems to return, so what's the point of them? Should my code even test for them? Why do c = stdscr.getch() if c in (curses....
user avatar
0 votes
1 answer
88 views

I'm using the curses python library in an application and have implemented a Textbox as well https://docs.python.org/3/library/curses.html#textbox-objects. Is there a way to add a default text when ...
wasp256's user avatar
  • 6,352
0 votes
1 answer
60 views

I'm writing a curses UI program in Python. I am using the curses wrapper and getting a screen object as a parameter to a function I've set up. I divide the screen up into some smaller windows using ...
user1200296's user avatar
1 vote
0 answers
26 views

Here is code to simply fill a terminal screen: import curses def main(stdscr): max_y = curses.LINES max_x = curses.COLS rows = max_y - 1 cols = max_x - 3 total_chars1 = rows *...
deostroll's user avatar
  • 12k
0 votes
0 answers
58 views

How do I find the "curses" module for python? I cannot find it anywhere and whatever I tried I could not obtain any useful results or information, I also checked in visual studio code ...
Average Python User's user avatar
0 votes
0 answers
41 views

So i'm building a command line script for installing gentoo and along the way decided i'd like to in as well beautify it or create a python curses menu alongside what functions i have handling ...
amadecember's user avatar
1 vote
1 answer
110 views

In below code box.gather() removes empty lines from text. Is there a way to collect the text as is including empty lines? from curses import wrapper from curses.textpad import Textbox def main(stdscr)...
Jacek Błocki's user avatar
0 votes
0 answers
83 views

Hey i got a lot of entities drawn with curses, they move dynamically and after i changed some code to async (for movement speed functionality) entities sometimes are flickering. What could be the ...
youwish's user avatar
  • 43
1 vote
0 answers
268 views

I installed the windows-curses library through pip, and it seemed to install without any issue. However whenever I try to run a program like this simple one below in gives me this error. Code: import ...
Galaxy Studios's user avatar
1 vote
1 answer
822 views

I have been reading the documentation on curses in Python but I cannot figure it out how to detect the combinations like CTRL-S, or CTRL-A, or ALT-X, or CMD+A (in macOS), etc. Anyone knows how to do ...
Nisanio's user avatar
1 vote
2 answers
7k views

I'am trying to run pip install curses in the CMD put it returns the error: ERROR: Could not find a version that satisfies the requirement curses (from versions: none) ERROR: No matching distribution ...
Fouad Alkai's user avatar
0 votes
1 answer
145 views

I am new to curses so am a little confused why I don't see any output from this little "hello world": import curses import time def main(window: curses.window): window.addstr(1, 1, "...
Hai Vu's user avatar
  • 41.5k
-1 votes
1 answer
67 views

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) # ...
GebogenerAllesFresser943's user avatar
0 votes
0 answers
127 views

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 ...
edge selcuk's user avatar
0 votes
1 answer
120 views

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 ...
Ore Noodles's user avatar
2 votes
2 answers
1k views

According to this link, https://docs.python.org/3/library/curses.html, the description for curses.resizeterm(), it should be possible to fix the width and height of my terminal window to a fixed ...
AmirHosein Sadeghimanesh's user avatar
0 votes
1 answer
288 views

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 ...
Enderbyte09's user avatar
2 votes
1 answer
125 views

In C curses, it is possible to store a character and associated attributes in a variable of type chtype (which is usually an unsigned int). This is useful when you want, for example, an easily ...
user avatar
0 votes
1 answer
3k views

import curses class TextEditor: def __init__(self): self.screen = curses.initscr() curses.noecho() curses.cbreak() self.screen.keypad(True) self.buffer = &...
user avatar
0 votes
1 answer
127 views

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() ...
thexbuttonisntworking's user avatar
1 vote
3 answers
548 views

I may be missing something very obvious, but I am confused by the optional [y, x] parameters to the window.getch( [y, x] ) method described in the Python documentation. What are these optional params ...
Wandering Logic's user avatar
3 votes
1 answer
2k views

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&...
Kahsius's user avatar
  • 847
3 votes
3 answers
5k views

The terminal I use on Windows is Mingw-w64 (Git Bash). I am trying to find or create a CLI menu with Python that I can navigate with arrow keys, however nothing I find works. The Python library, ...
Spedwards's user avatar
  • 4,510
0 votes
0 answers
52 views

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 ...
Marco's user avatar
  • 3
1 vote
0 answers
298 views

I tried searching everywhere on the internet, but nowhere did I find an answer that worked for me, so I'm asking a new question. In my code, I'm telling curses to get the terminal size and update some ...
Mymokol's user avatar
  • 43
0 votes
1 answer
113 views

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's user avatar
  • 13
0 votes
1 answer
661 views

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'...
DraftyHat's user avatar
  • 518
-1 votes
1 answer
385 views

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 ...
John's user avatar
  • 2,784
2 votes
2 answers
583 views

I am running Python 3.10 and I am having an issue with curses, specifically when trying to utilize the full range of color pairs curses.COLORS returns 256 curses.COLOR_PAIRS returns 65536 curses....
Daniel Griffin's user avatar
0 votes
0 answers
166 views

Just for fun, I am implementing a python program to generate Ulam spirals (https://en.wikipedia.org/wiki/Ulam_spiral) of arbitrary size. The program receives the size of the spiral and eventually the ...
Eduardo Gamboa Ureña's user avatar
0 votes
1 answer
233 views

so I was programing a snake game with curses and it's already there but python tells me that it doesn't exist import random import curses screen = curses.initscr() sh, sw = screen.getmaxyx() curses....
yacer meftah's user avatar
0 votes
1 answer
519 views

I've recently installed the windows-curses module on my machine, via py -m pip install windows-curses run in an elevated command prompt. I wrote the following code to test if it was working correctly. ...
Mous's user avatar
  • 1,047
-1 votes
2 answers
1k views

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 ...
Luke's user avatar
  • 1
0 votes
0 answers
76 views

The error looks like this: Traceback (most recent call last): File "main.py", line 136, in <module> curses.wrapper(main) File "/nix/store/p21fdyxqb3yqflpim7g8s1mymgpnqiv7-...
Alaric Malikov's user avatar
1 vote
1 answer
2k views

An example of what I would like to do is the following: import curses while True: key = stdscr.getch() if key == 119: print("key w pressed") else: ...
Andrew C's user avatar
  • 147
-1 votes
1 answer
86 views

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....
Debanjan Saha's user avatar
1 vote
2 answers
2k views

I'm thinking of creating a CLI app using python curses and rich libraries. As curses requires addstr method to print text to string, I'm unable to print using rich. Is it possible to integrate these ...
Sharukh Rahman's user avatar
0 votes
1 answer
86 views

Can anyone tell me how to take mouse input în Python curses? And if there is any way that I can create a custom cursor for the mouse inside the terminal when I run the program? curses.set_curs_char('*'...
Furtunos's user avatar
0 votes
0 answers
297 views

I want to dynamically disable the readline functionality by completely getting rid of it. Not by disabling tab completion or any other provided functionality, but to completely unhook it, free ...
mwo's user avatar
  • 456
1 vote
1 answer
748 views

Needed help with this code: import plotext as plt from contextlib import redirect_stdout import io import curses import locale locale.setlocale(locale.LC_ALL, '') code = locale.getpreferredencoding() ...
Nika Tvildiani's user avatar
0 votes
1 answer
839 views

I am trying to display text files in the terminal using curses, but some lines of the file are larger than the size of my terminal. How can I wrap this overflowing text to the next line? def ...
RandomPersonOnline's user avatar
0 votes
0 answers
246 views

my python code I'm trying to run: import curses, random def main(stdscr): stdscr.clear() for i in range(0, 21): stdscr.addstr(i, 0, f'count {i+1}, and rand value {random.randint(0, 100)}') stdscr....
shortpupper's user avatar
1 vote
0 answers
832 views

I am currently making a python project in curses, I want to know how to use the control and shift keys using stdscr.getch(), the other keys work, except for a few keys including ctrl and shift. The ...
kible's user avatar
  • 41
0 votes
0 answers
3k views

I am using windows and would like to use the curses package,I installed it with the command: pip install windows-curses but when I try to import curses it gives an eror from the python source file ...
Refael Buchris's user avatar
0 votes
0 answers
68 views

I am making a game using curses on python. My code is: from curses import wrapper import curses def main(stdscr): score = 0 stdscr.erase() text = ''' ╔╗─╔╦═══╦╗──╔╗──╔═══╗╔╗ ║║─║║╔══╣║──║...
eyah's user avatar
  • 111
1 vote
1 answer
668 views

For some style in my console applications, I'll often have a string print out one character at at time using code like this: import time def run(): the_string = "Hello world!" for ...
YangTegap's user avatar
  • 461

1
2 3 4 5 6