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

  • Python
  • Thread starter Swamp Thing
  • Start date
  • Tags
    Python
  • #1
Swamp Thing
Insights Author
908
572
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
2K
  • Programming and Computer Science
Replies
16
Views
2K
  • Programming and Computer Science
Replies
1
Views
282
  • Programming and Computer Science
2
Replies
55
Views
4K
  • Programming and Computer Science
Replies
3
Views
320
  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
Replies
4
Views
3K
Replies
3
Views
1K
  • Programming and Computer Science
Replies
12
Views
9K
  • Programming and Computer Science
Replies
1
Views
1K
Back
Top