It is a good practice to avoid hard-coding any strings that your GUI displays. You can separate the GUI code from the text that the GUI displays. Designing your GUI in such a modular way makes internationalizing it much easier. You can check out how it's
- [Narrator] In the previous video,…we displayed a widget text in different languages.…This is the second video…changing the entire GUI language all at once.…We will change the entire GUI display names,…all at once,…by refactoring all the previously hard-coded…English strings into a separate Python module.…Then, we'll use the same class members…to internationalize our GUI…by passing in a string as the initializer…of our i18n class,…effectively controlling the language, RGY displays.…
This video shows that it is a good design principle…to avoid hard-coding any strings…that are GUI displays,…but to separate the GUI code from the text…that the GUI displays.…Designing our GUI in a modular way…makes internationalizing it much easier.…We will continue to use the GUI from the previous video,…in which we had already internationalized…the title of the GUI.…How to do it?…In order to internationalize the text being displayed…in all of our GUI widgets,…we have to move all hard-coded strings…into a separate Python module,…and this is what we do next.…
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?
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.