I just recently learned Python and Pygame library. 
I noticed that the rendering and main loop is automatically paused when I click and hold on the window menu bar (the bar with the title/icon).
For example, in a snake game, the snake will be moving every frame. When I click and hold (or drag) the window menu, the snake is not moving anymore and the game is "paused". When I release it, it resumes.
Is there a way to let the game NOT pause when I drag the windows menu bar?
This one is pretty easy, its seems you forgot to add a event callback.
state 1
        while (sate != 0):
           for event in pygame.event.get():
Pygame built-in automatic pause?