How it works...
You can see that there are two classes in this script: one is the main class, called the MyForm class, which does the task of interacting with the GUI form. The second class is the myThread class, which creates and invokes two threads, which in turn will update the two Progress Bar widgets used in the GUI.
The import threading statement imports Thread into the current script. Thereafter, your class, myThread, inherits the Thread class. An object of the main class, MyForm, is made, called w. Thereafter, two threads are created, thread1 and thread2, by creating two instances of the myThread class. Because thread1 is supposed to update the progress bar that represents progress in file downloading while creating it, two parameters ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access