I am designing an app which has an event loop running forever.
While writing the code it crossed my mind that one could design the infinite loop in two ways:

1.

```
while True:
    is_on = True # or False
    while is_on: 
        # event loop
        ...

```

---

2. 

```
    while True:
        is_on = True # or False
        if is_on:
            # event_loop
            ...

```

Both seem to be valid and working. However, in the first one, in order to change the state of `is_on` one will have to do that from within the event loop, while in the second method one will change its state from the upper loop.

I don't seem to have the expertise to settle which one is better or more pythonic, but perhaps someone more qualified than me could provide an answer?