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

  • Python
  • Thread starter Swamp Thing
  • Start date
  • Tags
    Python
  • #1
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?
 
Technology news on Phys.org
  • #2
Try control-c it usually works as a keyboard interrupt.
 
  • Like
Likes PeterDonis and Swamp Thing

Similar threads

  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
Replies
16
Views
1K
  • Programming and Computer Science
Replies
1
Views
72
  • Programming and Computer Science
Replies
3
Views
240
  • Programming and Computer Science
Replies
15
Views
1K
Replies
3
Views
1K
  • Programming and Computer Science
Replies
4
Views
3K
  • Programming and Computer Science
Replies
12
Views
8K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
4
Views
2K
Back
Top