Wait for user to press key before printing text

So where exactly would i put this?

import sys

class TerminalInput:
    def __init__(self):
        self.input_buffer = []

    def read_line(self):
            # Read a line of input and append it to the buffer
            line = sys.stdin.readline().strip()
        except KeyboardInterrupt:
            print("\nInput interrupted. Exiting...")

    def process_input(self):
        while True:
            last_line = self.input_buffer[-1]
            if last_line.lower() == 'quit':

            print(f"Output: {last_line}")

    def run(self):
        print("'quit' to exit.")

if __name__ == "__main__":
    terminal = TerminalInput()

I can do it for you, if you just send your Repl link or code. :slight_smile:


1 Like

Alright, I will do it for you just give me like 5-10 minutes. I need to switch to my next study hall, I’m still in school. :sob:

1 Like

Im in lunch rn lol So i understand

1 Like

That’s the exact opposite of what OP wants.

@Galaxyzeke42 have you tried this?

1 Like

No, it isn’t. Please read OP message. They wanted it so that when they press a key on the keyboard, it will show up. The code I sent still meets the requirements and what’s requested. getkey() might be a better option, though, since it’s easier.

:woman_facepalming: no, that is not what OP wants. You misunderstood them.

1 Like

OHHHHH, my bad I didn’t read it all the way. :man_shrugging:

1 Like

Yes i tried that it didnt work

Does it just show the same error?

1 Like

Unfortunately it shows the same error

Oh, wait, so you want it to print something, then clear it and print the next text when someone clicks something?

I want it to work how the text in this repl works

1 Like

Can you invite me to your Repl?

1 Like

how do i do that???



kk there i invited you and also thank you CoderElijah!

1 Like

and im sorry for taking so long to reply i just now got off of school

1 Like

Did you finish querty?