+ 2

Input-instruction in Python console ...

Is there a possibility to preallocate the input field with a suggested value, so that the user 1) could accept this value by just hitting the return key, or 2) if he/she/it wants to choose another value, then hit backspace a couple of times and enter another one? I know that this could be done in a GUI with tkinter, but I am curious whether this is possible in a simple Python text-console, too.

12th Apr 2018, 1:34 PM
Jan Markus
3 Respuestas
+ 4
using the base console yes it's possible but will likely be clunky. instead you may wanna look for a module that handles the console like ncurses, which many rougelike ascii text games use
22nd Apr 2018, 12:21 PM
Ahri Fox
Ahri Fox - avatar
+ 1
i dont think so. because: 1) ive never heard about this option 2) i dont think so because i think the Python IDLE shell does not recognise if some of its content is deleted
12th Apr 2018, 5:21 PM
Tim
Tim - avatar
+ 1
@ Tim Thank you for your response. I did not either but I hoped that some of the Python professionals could have an answer to this.
12th Apr 2018, 5:24 PM
Jan Markus