Exit Interactive Prompt

I am new to coding and Python, I am presently having a problem getting my screen out of interactive mode. I used the exit() and then ctrl+z to reopen it but no luck and now ctrl+z don’t open anything.

Really want to learn coding, but I can’t built code in the interactive mode.

PLEASE HELP!

In which operating system does Ctrl+Z reopen the last application to be closed? On Windows Ctrl+Z then Enter, or Ctrl+D both exit the REPL (Ctrl+C throws KeyboardInterrupt), and I’ve never heard of any way to reopen the thing I just closed. I just press Up in the parent shell to rerun the last command in the history (but this can get unintuitive if scrolling through it with Down too, and errors being thrown). I’ve not heard of such a thing in Linux either (my ignorance doesn’t prove anything, but I have been around a while… ).

On UNIX, ctrl+z without typing exit() pauses a program then running fg (foreground) resumes it. I’ve never heard of an equivalent on Windows.

2 Likes

Well, Ctrl+Z is a shortcut key for undo, so undoing exit does have a kind of logic to it! :slight_smile:

I can’t say I wouldn’t use that, Ctrl_Z’s in File Explorer already. I suspect Brénainn hit the nail on the head though.