Cerca

Heus ací els resultats de la cerca.

2.1 File processing - XML files @info:cursos:pue:python-pcpp1:m5
92 Resultats, Darrera modificació:
ng modules for working with XML: * **xml.etree.ElementTree** – has a very simple API for analyzing ... e and process XML documents using the ''xml.etree.ElementTree'' module. Let's not waste any time. Let'... ended by the W3C organization. Let's look at what elements XML documents contain: * **prolog** – the... racter encoding (UTF-8) to ISO-8859-2. * **root element** – the XML document must have one root elem
1.5 What is XML and why do we prefer to use JSON? @info:cursos:pue:python-pcpp1:m4
48 Resultats, Darrera modificació:
n't it? Of course, a comment, like any other XML element, can be spread over more than one line. XML ... for_sale> </code> The XML document consists of **elements**. Each element is marked by a **pair of tags**: an **opening** tag and a **closing** tag. Both... osed inside **<** and** >**. This means that the element named ''CuriousTag'' starts where the follow
1.7 Four magic letters: CRUD @info:cursos:pue:python-pcpp1:m4
43 Resultats, Darrera modificació:
r to perform a basic set of operations – they are elementary, but complex enough to build complex serv... equestException: print("Communication error") else: if reply.status_code == requests.codes.ok: print(reply.text) else: print("Server error") </code> * lin... 0/cars") except: print("Communication error") else: if reply.status_code == requests.codes.ok:
2.9 Inheriting properties from built-in classes @info:cursos:pue:python-pcpp1:m1
33 Resultats, Darrera modificació:
ion of our own list class, which will only accept elements of the integer type. But, wait – why might ... implementation and will also validate the type of elements that are about to be placed onto it. Such ... be used in an application that requires the list elements to be of a specific type (integers in the ticketing example), and control over the types of elements is given to the mechanisms of the new class
Python Professional Course Series: GUI Programming @info:cursos:pue:python-pcpp1:m3
12 Resultats, Darrera modificació:
0231219-025303.png }} It was just text – usually elegantly formatted, sometimes colorized (but still ... eir own style and colors of virtually all the GUI elements. Some operating systems devote the whole s... mouse's movements, clicks targeting selected GUI elements, or by dragging other elements. Touch screens may offer something more: tapping (single or doub
4.1 PEP 257 – Docstring Conventions @info:cursos:pue:python-pcpp1:m2
11 Resultats, Darrera modificació:
Before we move on from talking about comments to elaborating on docstrings, there is one more Python ... uage itself to serve this purpose. This may be an elegant and useful way to highlight some of the more... functions, and method definitions. Now we want to elaborate on this: there are cases where they not on... ummary line followed by one blank line and a more elaborate description. Let's talk a bit more about e
2.6 Abstract classes @info:cursos:pue:python-pcpp1:m1
9 Resultats, Darrera modificació:
nized as an abstract one, because it inherits all elements of its super class, which is abstract, and ... def scan_document(self): print("El document ha estat escanejat") def get_scanner... f): fax = "" if self.fax_machine == False else ", Fax" print( "màxima resolució scanne... r) ) def print_document(self): print("El document ha estat imprés") def get_printer_st
2.8 Composition vs Inheritance - two ways to the same destination @info:cursos:pue:python-pcpp1:m1
9 Resultats, Darrera modificació:
15), off-road tires (size: 18) * two engines: electric engine, petrol engine * instantiate two o... s: * the first one is a city car, built of an electric engine and city tires * the second one ... s cityTires = Tires(15) offRoadTires = Tires(18) electricEngine = Engine("Electric") petrolEngine = Engine("Petrol") car1 = Car(electricEngine, cityTire
1.4 Talking to JSON in Python @info:cursos:pue:python-pcpp1:m4
9 Resultats, Darrera modificació:
expect anything more: <code python> import json electron = 1.602176620898E10−19 print(json.dumps(electron)) </code> The code outputs: <code ; output> 16... isinstance(w, Who): return w.__dict__ else: raise TypeError(w.__class__.__name__ +... ce(w, Who): return w.__dict__ else: return super().default(self, z)
2.1 Python core syntax @info:cursos:pue:python-pcpp1:m1
8 Resultats, Darrera modificació:
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... tion. If you’re developing an application for an elevator, then you should remember that every elevat
2.5 Different faces of Python methods @info:cursos:pue:python-pcpp1:m1
8 Resultats, Darrera modificació:
len(iban) == 20: return True else: return False </code> *... len(iban) == 20: return True else: return False account_numbers = ['8' * 20, '7' * 4, '2222'] for element in account_numbers: if Bank_Account.validate(element): print('We can use', element, ' to
2.7 Encapsulation @info:cursos:pue:python-pcpp1:m1
8 Resultats, Darrera modificació:
self.__level = amount else: raise TankError('Too much liquid in the tank') elif amount < 0: raise TankError('Not po... self.__level = amount else: raise TankError('Too much liquid in the tank') elif amount < 0: raise TankError('Not po
3.1 PEP 8 – Introduction @info:cursos:pue:python-pcpp1:m2
6 Resultats, Darrera modificació:
rs / how_many_numbers return average else: return "Nothing happens." </code> == ... t (e.g., give your variables, functions, and code elements proper names). There are a few rules you s... single-letter names like l (the lowercase letter el), I (the uppercase letter eye), and O (the upperc... 2 > 1 if my_boolean_value == True: print("A") else: print("B") </code> <code python ✔> # Good
1.7 Visiting widgets’ properties @info:cursos:pue:python-pcpp1:m3
6 Resultats, Darrera modificació:
] if state == "ON": state = "OFF" else: state = "ON" button["text"] = stat... ) if state == "ON": state = "OFF" else: state = "ON" button.config(text=st... mple. Any font can be described as two- or three-element tuples: <code python> ("font_family_name", "... , "font_size", "font_style") </code> * the two-element tuple contains two strings: the first contai
2.5 Working with the Canvas @info:cursos:pue:python-pcpp1:m3
6 Resultats, Darrera modificació:
d(row=1) window.mainloop() </code> Drawing an **ellipse** (and a **circle** is, in fact, a specific ellipse) needs a method named create_oval(): <code ... ,y1,xn,yn,option...) </code> The method draws an ellipse inscribed in a rectangle with vertices at th... d (x1,y1). If the rectangle is a **square**, the ellipse becomes a **circle**. The options are the s
5.1 Metaprogramming @info:cursos:pue:python-pcpp1:m1
5 Resultats, Darrera modificació:
2.1 PEP 20 – The Zen of Python @info:cursos:pue:python-pcpp1:m2
5 Resultats, Darrera modificació:
1.6 Events and how to handle them @info:cursos:pue:python-pcpp1:m3
5 Resultats, Darrera modificació:
1.2 How to use sockets in Python @info:cursos:pue:python-pcpp1:m4
4 Resultats, Darrera modificació:
1.2 Let TkInter speak! @info:cursos:pue:python-pcpp1:m3
3 Resultats, Darrera modificació:
1.8 Interacting with widget methods @info:cursos:pue:python-pcpp1:m3
3 Resultats, Darrera modificació:
4.1 Shallow and deep copy operations @info:cursos:pue:python-pcpp1:m1
2 Resultats, Darrera modificació:
1.3 JSON – our new friend @info:cursos:pue:python-pcpp1:m4
2 Resultats, Darrera modificació:
1.1 SQLite @info:cursos:pue:python-pcpp1:m5
2 Resultats, Darrera modificació: