Ctrl+c will issue a KeyboardInterrupt which breaks out of programs such as the one you described. (The only situation it doesn't is when the program catches that exception. You won't see that 'til you get your sea legs ;-)