Design patterns are a very exciting tool in your software development toolbox. Learn how to incorporate them in your code.
- [Instructor] In the previous video,…we saw when not to use OOP.…We're now discussing how to use design patterns.…In this video, we will create widgets…for our Python GUI by using the factory design pattern.…In previous videos, we created our widgets…either manually, one at a time,…or dynamically, in a loop.…Using the factory design pattern,…we will use the factory to create our widgets.…
We will create a Python GUI which has three buttons,…each having different styles.…Towards the top of our Python GUI module,…just below the import statements,…we create several classes.…We create a base class,…which our different button style classes inherit from,…and in which each of them overrides the relief…and foreground configuration properties.…
All subclasses inherit the getButtonConfig method.…From this base class, this method returns a tuple.…We also create a ButtonFactory class…and a list that holds the names of our button subclasses.…We name the list buttonTypes…as our factory will create different types of buttons.…
Author
Released
7/7/2017Note: 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
Duration
Views
Related Courses
-
Code Clinic: Python
with Barron Stone2h 23m Intermediate -
Python GUI Development with Tkinter
with Barron Stone4h 55m Intermediate -
Python: Design Patterns
with Jungwoo Ryoo1h 59m Intermediate
-
1. Creating the GUI Form and Adding Widgets
-
Introduction to Python GUI4m 45s
-
Exploring widgets5m 55s
-
Adding extra features9m 2s
-
-
2. Layout Management
-
Creating menu bars6m 30s
-
Creating tabbed widgets7m 5s
-
3. Look and Feel Customization
-
Creating message boxes4m 46s
-
Using a spinbox control5m 24s
-
-
4. Data and Classes
-
Using the StringVar() type8m 14s
-
-
5. Matplotlib Charts
-
Creating our first chart2m 14s
-
Placing labels on charts5m 9s
-
Giving the chart a legend3m 32s
-
Scaling charts2m 56s
-
6. Threads and Networking
-
Creating multiple threads4m 56s
-
Starting a thread4m 56s
-
Stopping a thread4m 18s
-
Using queues6m 10s
-
-
7. Storing Data in Our MySQL Database via Our GUI
-
Using the SQL INSERT command3m 28s
-
Using the SQL UPDATE command3m 17s
-
Using the SQL DELETE command5m 52s
-
8. Internationalization and Testing
-
Localizing the GUI6m 56s
-
Setting debug watches6m 46s
-
9. Extending Our GUI with the wxPython Library
-
Creating our GUI3m 59s
-
Adding controls7m 17s
-
10. Creating Amazing 3D GUIs with PyOpenGL and Pyglet
-
Pyopengl transforms our GUI6m 27s
-
Our GUI in 3D4m 50s
-
-
11. Best Practices
-
Avoiding spaghetti code3m 52s
-
When not to use OOP2m 52s
-
Avoiding complexity5m 57s
-
- 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.
CancelTake 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.
Share this video
Embed this video
Video: Using design patterns successfully