Cerca
Heus ací els resultats de la cerca.
Resultats de text complet:
- 2.6 Abstract classes @info:cursos:pue:python-pcpp1:m1
- ies or an order in a class hierarchy. When you develop a system in a group of programmers, it would be... **abstract methods**. * The programmer has to deliver all method definitions and the completeness w... ted by another, dedicated module. The programmer delivers the method definitions by __overriding__ the... ode to be polymorphic, so all subclasses have to deliver a set of their own method implementations in
- 2.7 Encapsulation @info:cursos:pue:python-pcpp1:m1
- xample is a money bank; this time it’s a more IT-related example: When your money ( **attribute value... attributes **intentionally** as Python does not deliver true privacy. Why? Guido Van Rossum, best k... the behavior of a class representing a water or fuel tank: It would not be wise to pour any amount of... l tank capacity, or request setting the liquid level to a negative value. Python allows you to contro
- 1.7 Four magic letters: CRUD @info:cursos:pue:python-pcpp1:m4
- the service) may vary, e.g., it may be a simple relational database residing in a single file, or on ... h one, **universal interface**. The interface itself enables the user to perform a basic set of operations – they are elementary, but complex enough to build complex serv... t's data in a customer database, etc. At REST level, the creation of new items is implemented by the
- 2.1 File processing - XML files @info:cursos:pue:python-pcpp1:m5
- ng modules for working with XML: * **xml.etree.ElementTree** – has a very simple API for analyzing and creating XML data. It's an excellent choice for people who have never worked with the Document Object Model (DOM) before. * **xml.dom.minidom** – is the minimum implementation of the Document Object Model (DOM). Using the DOM, the approach to an XML docu
- 2.8 Composition vs Inheritance - two ways to the same destination @info:cursos:pue:python-pcpp1:m1
- ing and following the inheritance concept when modeling our classes to represent real-life issues. Inh... oundations of object-oriented programming that models a tight relation between two classes: the base class and the derived class, called a subclass. The result of this relation is a subclass class that inherits **all** me
- 4.1 PEP 257 – Docstring Conventions @info:cursos:pue:python-pcpp1:m2
- 57 is a document created as part of the Python Developer's Guide, which makes an attempt to standardize the high-level structure of docstrings. It outlines the **conven... r piece of code in a **prescriptive** way. They help programmers (including you) to remember and unde... menting and documenting code? Look at the table below, where we want to show you some of the differen
- 1.5 What is XML and why do we prefer to use JSON? @info:cursos:pue:python-pcpp1:m4
- nguage**. Anyway, this is what it thinks about itself. Note – it isn't a programming language, and alt... "utf-8"?> <!-- cars.xml - List of cars ready to sell --> <!DOCTYPE cars_for_sale SYSTEM "cars.dtd"> <... <id>1</id> <brand>Ford</brand> <model>Mustang</model> <production_year>1972</production_year> <price currency="USD">35900</pric
- 2.1 Python core syntax @info:cursos:pue:python-pcpp1:m1
- ols representing operators, or to get a number of elements in a sequence or dictionary. We are able t... se the same function ''len()'' to get a number of elements of a tuple, list, dictionary, or characters... xion – isinstance(), issubclass() and a few more elements. Python allows us to employ operators when... it mean to add two objects of the Person class? Well, it depends on the domain of your application.
- 2.9 Inheriting properties from built-in classes @info:cursos:pue:python-pcpp1:m1
- ly-created class has the advantage of all of the well-known functionalities inherited from its parent ... methods. Later, you can override the methods by delivering your own modifications for the selected methods. In the following example, we’ll create an im... ion of our own list class, which will only accept elements of the integer type. But, wait – why might
- 2.3 A small lexicon of widgets - Part 3 @info:cursos:pue:python-pcpp1:m3
- art 3 There are two remaining widgets we want to tell you about – the first one is just a widget, whil... operations like inserting, removing, scrolling, selecting, copying and pasting, etc.. We’ll show you... es of the widget, as it’s full equipment is extremely complex. Fortunately, we don’t need its entire flexibility when we just want to enter and validate a
- 2.1 PEP 20 – The Zen of Python @info:cursos:pue:python-pcpp1:m2
- sions, we assure you that the aphorisms are extremely practical and common sense, and you’re encourage... is a rather subjective experience. But, as Immanuel Kant said, the very **esthetic experience of beau... hetics, people do, and we must remember that a nicely-written program is not only more enjoyable to re... use an implicit feature of the language, ask yourself whether you really need it. Maybe there’s a bett
- 3.1 PEP 8 – Introduction @info:cursos:pue:python-pcpp1:m2
- for every professional Python programmer, as it helps to make the code more consistent, more readable... rogramming projects may adopt their own style guidelines (in which case such project-specific guidelines may be favored over the conventions provided for ... es are still highly recommended reading, as they help you to better understand the philosophy behind P
- 4.1 Logging in Python @info:cursos:pue:python-pcpp1:m5
- If your application is simple, as in the example below, you can use the root logger. To do this, call ... on> import logging logger = logging.getLogger() hello_logger = logging.getLogger('hello') hello_world_logger = logging.getLogger('hello.world') recommended_logger = logging.getLogger(__na
- 4.3 Making Python objects persistent using the shelve module @info:cursos:pue:python-pcpp1:m1
- 4.3 Making Python objects persistent using the shelve module == Serialization of Python objects using the shelve module As you remember, the pickle module is us... lizing parties must abide by the order of all the elements placed into a file or database, or sent via... network. There is another handy module, called shelve, that is built on top of pickle, and implements
- Python Professional Course Series: GUI Programming @info:cursos:pue:python-pcpp1:m3
- ’s a three-letter acronym, a representative of a well-known class of acronyms which plays a very impor... ce is graphical? We have to do a little time traveling to understand that. Don’t worry, it won’t take long. We’re going to travel not more than fifty years back. Are you ready? Ok... uter, you needed to have a specialized and completely separate device called a **terminal**. The termi