If you don't call methods of your GUI class to start the threads, the thread gets created but just sits there waiting for us to run its target method. Learn how to tackle this.
- [Instructor] In the previous video,…we created multiple threads.…This video will show us how to start a thread.…It will also demonstrate why threads are necessary…to keep our GUI responsive during long-running tasks.…Let's first see what happens when we call a…function, or method, of our GUI…that has some sleep associated with it…without using threads.…We are using a sleep here to simulate…a real world application that might have to wait…for a web server or database to respond,…or a large file transfer, or complex computation…to complete its task.…
The sleep is a very realistic placeholder…and shows the principle involved.…Adding a loop into our button call back method…with some sleep time results in our GUI…becoming unresponsive.…And when we try to close the GUI, things get even worse.…So let's add a code to solve this.…Let's check the output.…
If we wait long enough, the method…will eventually complete.…But during this time,…none of our GUI widgets respond to click events.…We solved this problem by using threads.…
Note: This course was created by Packt Publishing. We are pleased to host this training in our library.
- Creating buttons and widgets
- Adding labels and features
- Expanding a GUI dynamically
- Aligning frames and embedding frames
- Creating menu bars, message boxes, and tooltips
- Using module-level global variables
- Coding in classes
- Using Matplotlib to create charts
- Working with multiple threads, queues, and TCP/IP
- Using URLOpen to read data from websites
- Localizing a GUI and preparing for internationalization
- Testing a GUI using unit tests and Eclipse PyDev IDE
- Using the wxPython library
- Using Tkinter, PyOpenGL, and Pyglet
Skill Level Intermediate
1. Creating the GUI Form and Adding Widgets
2. Layout Management
3. Look and Feel Customization
4. Data and Classes
Using the StringVar() type8m 14s
5. Matplotlib Charts
6. Threads and Networking
7. Storing Data in Our MySQL Database via Our GUI
8. Internationalization and Testing
9. Extending Our GUI with the wxPython Library
10. Creating Amazing 3D GUIs with PyOpenGL and Pyglet
11. Best Practices
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.