That is because you never reach the call to a.exec(). This code continuously executes the loop, and as it can never leave the loop because the loop's condition is always true, the code beyond is never executed.
Here a.exec() starts a new loop, that is why your original loop is only executed once.
If you want to display some data polled from a device you should probably use a seperate thread that does the polling and notifies the GUI via a signal if something changed. Have a look at the thread examples to see how this is done.
Bookmarks