sorry, one more question. if the problem is your main loop, you could kill your main loop's activity before launching the webbrowser; i.e check for a flag at the start if each loop, and make sure you delay long enough that the loop is done, or use a Semaphore, etc.
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.