Linked Questions

Popular Questions

easiest way to pause a command-line python program?

Asked by At

Let's say I have a python program that is spitting out lines of text, such as:

while 1:
  print "This is a line"

What's the easiest way to allow one to press a key on the keyboard to pause the loop, then to resume if pressed again---but if nothing is pressed it should just continue on automatically?

I'm hoping I don't have to go into something like curses to get this!

Related Questions