title: Pygame nested while loop: [Errno 10054] An existing connection was forcibly closed by the remote host
body: <p>I am using pygame with pyscripter and pyopengl, and am trying to put a while loop inside the main while loop, but as soon as the game enters the inner loop, it repeats the loop forever and I can't get out</p>
  
  <pre><code>running = True
  while running:
      keys=pygame.key.get_pressed()
  
      ## do game stuff
  
      if keys[K_l]:
          a=True
          while a:
              keys2=pygame.key.get_pressed()
              ## do something
              print a
              if keys2[K_p]:
                  a = False
                  break
  
      for event in pygame.event.get():
          if event.type == pygame.QUIT or keys[K_ESCAPE]:
              running = False
              pygame.quit()
              sys.exit()
  </code></pre>
  
  <p>After pressing l, this continuously prints <code>True</code> even if I press p</p>
  
  <p>How can I exit the inside loop?</p>