I have serious problems with building a functional module in which you have to use more than 1 while loop, because the program stops running.
Especially when I use modules like pygame and tkinter, in which my goal is to build a game, but I need to use more than 1 while loop, but if I put it to run it stops working. In this situation I intend to run two loops at the same time, but the window stops responding. Why?
---------------------------- ####### ------------ --------------------------
I also did not understand why my while loop does not exist when I turn the variable 'playing' True? In this situation I only want to run one while loop at a time, and the switch off of the while loop is when the 'playing' variable is True. Here is the code:
playing = False
def play():
playing = True
def gameloop():
...
play()
while not playing:
gameloop()
while playing:
gameDisplay.fill(black)
pygame.display.update()
clock.tick(15)
The problem is that the second while loop does not run and the first one does not stop running when I call the play () function, even if I declare the global 'playing' variable. Why?
Using python 3.5.0 with Windows 10
I do not see why windows stop responding when I run more than one while loop, because other people's PCs work perfectly. Will the problem be on my pc?