Stop current Python REPL command, but keep REPL session open?

  • Topic: Python 
  • Thread starter Swamp Thing
  • Start date
  • Tags Tags
    Python
1 reply · 3K views · last reply
Swamp Thing
Insights Author
Messages
1,079
Reaction score
849
If you just typed in a command into the Python repl, and it is stuck in a synchronous "waiting-for-something-to-happen", how can we terminate just that command and return to the same repl session?

For example, say we typed websocket.recv() and the websocket is waiting for a message... how can we end that and get back to the repl prompt without losing the whole session?