EverythingIs An Object
After the introduction to Python in the previous issue, this article deals with object orientation. As a practical exercise, you'll be programming a simple graphical user interface.
|
©Kirsty Pargeter, Fotolia.com
After the introduction to Python in the previous issue, this article deals with object orientation. As a practical exercise, you'll be programming a simple graphical user interface.
Before you design a GUI with Python, you need to understand a few basics about object-oriented programming. That's because object-oriented programming is what you'll need to create a graphical user.
Because everything is an object in Python, you often need to design your own objects before you can use them in your program. Admittedly, this is a somewhat abstract concept. I'll use an example from daily life to make it easier to understand. A shirt is an object. Object-oriented code can represent this shirt as an abstract concept as shown in Listing 1. As always, you can find the source code for the examples on the Ubuntu User website [1].
Right on the first line, you specify the file encoding with # - * - coding: utf-8 - * - , which allows you to use characters from all languages in your (unicode) strings and comments. Of course, you need to save this file in the indicated encoding or the program will fail to start. How you go about this depends on the editor you use. With Gedit, you can use the menu item File | Save as and choose the encoding.
[...]
Pages: 4
In this exclusive interview, Susan Spencer Conklin tells Linux Pro Magazine how she re-entered the open source world with a project that combines her programming skills with her interest in fashion. Susan explains how her vision for an open source fashion tool has expanded since she first introduced the Tau Meta Tau Physica application at the Libre Graphics Meeting in Brussels last fall.
To get rid of tedious manual testing for the Unity shell, Ubuntu developers invented a framework for automated functional testing. Over time, its scope has extended beyond Unity, making it possible to test any graphical application.
The JavaScript language has developed into an important programming language. We explain the basics and provide examples for accessing an open HTML page through the DOM interface.
Want to know more about Debian Packaging, Git, Python Libraries and more? The Debian Women Project is sponsoring a series of online learning sessions on those topics.
© 2025 Linux New Media USA, LLC – Legal Notice