Cerca
Heus ací els resultats de la cerca.
Resultats de text complet:
- 1.7 Four magic letters: CRUD @info:cursos:pue:python-pcpp1:m4
- hod. == To make our set complete, we need D for Delete. Deletion occurs when you remove your post from the blog, purge a picture from the gallery or cancel a customer’s account. At REST level, deleting existing data is implemented by the DELETE HTTP method. Now we’re ready to carry out some simpl
- 2.7 Encapsulation @info:cursos:pue:python-pcpp1:m1
- r attributes **intentionally** as Python does not deliver true privacy. Why? Guido Van Rossum, best k... attribute, and before the method responsible for deleting the encapsulated attribute. Let's have look... ssible to set negative liquid level') @level.deleter def level(self): if self.__level ... ct has a ''%%__level%%'' attribute, and the class delivers the methods responsible for handling access
- 1.5 What is XML and why do we prefer to use JSON? @info:cursos:pue:python-pcpp1:m4
- <id>1</id> <brand>Ford</brand> <model>Mustang</model> <production_year>1972</production_year> <price currency="USD">35900</price... 2</id> <brand>Aston Martin</brand> <model>Rapide</model> <production_year>2010</production_year> <price currency="GBP">32000</price>
- 2.6 Abstract classes @info:cursos:pue:python-pcpp1:m1
- d **abstract methods**. * The programmer has to deliver all method definitions and the completeness w... ated by another, dedicated module. The programmer delivers the method definitions by __overriding__ the... code to be polymorphic, so all subclasses have to deliver a set of their own method implementations in ... ework your music player code, you’ll just have to deliver a class supporting the new file format, fulfi
- 2.9 Inheriting properties from built-in classes @info:cursos:pue:python-pcpp1:m1
- methods. Later, you can override the methods by delivering your own modifications for the selected me... ething that’s worth commenting on is that we have delivered: * a static, dedicated method for checking argument types. As we have delegated this responsibility to only one method, the... ction of elements to the object. What have we not delivered? * All the remaining methods have remain
- 2.8 Composition vs Inheritance - two ways to the same destination @info:cursos:pue:python-pcpp1:m1
- sing and following the inheritance concept when modeling our classes to represent real-life issues. Inh... foundations of object-oriented programming that models a tight relation between two classes: the base c... asses are **tightly** coupled. **Inheritance** models what is called an **is a** relation. Examples: ... sing a concept named composition. This concept models another kind of relation between objects; it mod
- 4.1 Shallow and deep copy operations @info:cursos:pue:python-pcpp1:m1
- * is implemented by the ''deepcopy()'' function, delivered by the python 'copy' module {{ :info:cursos... lead you to the total weight details of the given delicacy. The input is presented in the editor; * P... then iterate over it to reduce the price of each delicacy by 20% if its weight exceeds the value of 30... w let's rework the code a bit: * introduce the Delicacy class to represent a generic delicacy. The o
- 1.1 SQLite @info:cursos:pue:python-pcpp1:m5
- ng a database structure; * inserting, updating, deleting, and searching data; * ensuring data secur... 0, 1)) c.commit() c.close() </code> == sqlite3 – deleting data After completing a task, we would like ... o do this, we must use the SQL statement called ''DELETE'': <code sql>DELETE FROM table_name WHERE condition;</code> Let's look at what removing the task wi
- 1.1 What is PEP? @info:cursos:pue:python-pcpp1:m2
- ads. These are: * **PEP 1 – PEP Purpose and Guidelines**, which provides information about the purpo... e of PEPs, their types, and introduces general guidelines; * **PEP 8 – Style Guide for Python Code**,... 257 – Docstring Conventions**, which provides guidelines for conventions and semantics associated with... nd awareness grow. == PEP 1 – PEP Purpose and Guidelines PEP is an acronym that stands for **Python En
- 2.1 Python core syntax @info:cursos:pue:python-pcpp1:m1
- the core syntax are translated into magic methods delivered by specific classes. So Python knows what ... ed to the __len__() method. These methods must be delivered by a class (now it’s clear why we treat cla... __and__', '__bool__', '__ceil__', '__class__', '__delattr__', '__dir__', '__divmod__', '__doc__', '__eq... e look somehow familiar, so let's see the details delivered by Python itself. The Python help() functi
- 2.2 Inheritance and polymorphism — Inheritance as a pillar of OOP @info:cursos:pue:python-pcpp1:m1
- g, printing, and sending via fax. The methods are delivered by the following classes: * scan(), delivered by the Scanner class; * print(), delivered by the Printer class; * send() and print(), delivered by the Fax class. Each method should print
- 3.1 PEP 8 – Introduction @info:cursos:pue:python-pcpp1:m2
- programming projects may adopt their own style guidelines (in which case such project-specific guidelines may be favored over the conventions provided for b... When should you **ignore** some specific PEP 8 guidelines (or at least consider doing so)? * If foll... ormat your Python code to conform to the PEP 8 guidelines. To be able to use it, you need the //pycodes
- 1.4 Coloring your widgets @info:cursos:pue:python-pcpp1:m3
- omenon is utilized by the so-called **RGB color model** which is one of the additive color models and it's widely used in many application, e.g. in color displays of different kinds. One of the RGB model implementations allows you to set the **saturatio
- 1.9 Looking at variables @info:cursos:pue:python-pcpp1:m3
- ble’s annihilation (removing the object through ''del'') * a reference to a function which will be in... the observer is done with a method named ''trace_vdelete()'': <code python> variable.trace_vdelete(trace_mode,obsid) </code> Its arguments’ meanings are as... + 'd') # read followed by write variable.trace_vdelete("r", r_obsid) variable.set(variable.get() + 'e
- 2.1 PEP 20 – The Zen of Python @info:cursos:pue:python-pcpp1:m2
- cuse for writing code that does not follow the guidelines. It’s not only about readability, though it ... others they may bitterly disappoint you. This guideline conveys a twofold message: on the one hand, it... best way to achieve a particular goal**. The guideline also reminds us that it’s a good idea to **fol... buts” and “ifs” which tell you to wait longer and delay things. Before you actually get down to doing t