0

I just wanted to know if there is a way to have a placeholder for the input function? using custom code or a library?

on python 3.11

Example:

Enter Your Name: John Doe

Here John Doe would be the placeholder and when any character is typed it disappears and vice versa, is there a way to do this? maybe with escape codes or curses or some other module? also would be nice if the color of the placeholder is grey or not the same as the prompt

  • Does this answer your question? [Show default value for editing on Python input possible?](https://stackoverflow.com/questions/2533120/show-default-value-for-editing-on-python-input-possible) – JonSG Jun 20 '23 at 13:48
  • @JonSG no it does not, i said i want to remove the placeholder when a character is typed non of these do that – Ore Noodles Jun 25 '23 at 08:28
  • This is less about Python and more about the terminal. Yes, you can do arbitrary terminal manipulations using the curses library or similar, but that may in fact be a lot of work. Your best bet might be to look for existing libraries that already implement such a thing for you. – deceze Jun 25 '23 at 08:34

0 Answers0