1

When I open python 2.7.9 in the command terminal in Windows 8 and I run this program:

while True:

    for i in ["/","-","|","\\","|"]:

        print "%s\r" % i,

How can I terminate this program without closing the command terminal? I apologize in advance if this is a novice question but I'm still a rookie when it comes to programming and I rarely use the command terminal. Thanks! :)

Totem
  • 7,189
  • 5
  • 39
  • 66
  • See this one http://stackoverflow.com/questions/3591807/how-can-i-stop-python-exe-from-closing-immediately-after-i-get-an-output – Sebastian Wozny May 03 '15 at 20:52
  • @SebastianWozny why would you refer the OP to a question that is itself a duplicate? – abcd May 03 '15 at 20:59
  • @SkipperDavies do you want to terminate it when a particular condition has been met? at a particular time? or just at your own whim (in which case `Ctrl+C` is probably the only option that makes sense)? if not the latter, there are better ways to program in a termination. – abcd May 03 '15 at 21:00

1 Answers1

1

Generally I find that Ctrl+c does the job. It's a keyboard interrupt that should halt most python activity in the interpreter/terminal on both windows and linux

Totem
  • 7,189
  • 5
  • 39
  • 66