Skip to content
Advertisement

How to update window and simultaneously run a background process?

New to Python and Kivy. The issue might be not understanding how the main thread of Kivy works, or how to add to the main thread.

The following is made-up code to demonstrate the current problem.

JavaScript

The application starts on a first screen. On the first screen is a progress bar that starts automatically and, in about five seconds, the application goes to the second screen. On the second screen, there is another progress bar that is supposed to start immediately and also last for about five seconds, but it waits until after the server starts before beginning. (The sleep(10) is there solely for dramatic affect to demonstrate how the progress bar does not start immediately upon entering the screen, and because the actual process takes about ten seconds to complete.)

How would one go about making the progress bar update in the window at the same time as start_server (or any other background process that takes ten seconds to complete) in the background?

Advertisement

Answer

Via adywizard over on Reddit

JavaScript
Advertisement