Although Python comes built-in with object-oriented programming capabilities, for some tasks, OOP does not make sense.
- In the previous video we saw…how to mix Falldown and OOP code.…This video will show you when not to use OOP.…We will create a Python GUI, similar to previous videos.…Then we will compare the OOP code…to the non-OOP alternative way of programming.…Python comes built in with…object oriented programming capabilities,…but at the same time we can write scripts…that do not need to use OOP.…
For some tasks OOP does not make sense.…Let's first create a new GUI, using OOP methodolgy.…This code, GUI_OOP.py, will create the GUI using OOP.…We can achieve the same GUI, without using an OOP approach,…by restructuring our code, slightly.…First we remove the OOP class and it's init method.…
Next we move all methods to the left…and remove the self class reference,…which turns them into unbound functions.…We also remove any other self references…our previous code had.…So, I've already done all of this.…I've already done all of this…in a file called GUI_Not_OOP.py.…
The refactored code is shown here.…We also have to move the createwidgets function call…
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.