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! :)

3
  • See this one stackoverflow.com/questions/3591807/… Commented May 3, 2015 at 20:52
  • @SebastianWozny why would you refer the OP to a question that is itself a duplicate? Commented May 3, 2015 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. Commented May 3, 2015 at 21:00

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.