Cerca
Heus ací els resultats de la cerca.
Resultats de text complet:
- 2.4 Decorators @info:cursos:pue:python-pcpp1:m1
- e of related objects. Python is able to decorate functions, methods, and classes. The decorator's operation is based on wrapping the original function with a new "decorating" function (or class), hence the name "decoration". This is done by passing the original function (i.e., the **decorated** function) as a para
- 2.7 Encapsulation @info:cursos:pue:python-pcpp1:m1
- ribute encapsulation Encapsulation is one of the fundamental concepts in object-oriented programming (... hism, and abstraction). It describes the idea of bundling attributes and methods that work on those at... inside a class like in a **capsule**, preventing unauthorized parties' direct access to them. Publicl... object. This can be a way to enforce a certain amount of privacy for the attributes. This picture pre
- 4.1 PEP 257 – Docstring Conventions @info:cursos:pue:python-pcpp1:m2
- that occurs as the first statement in a module, function, class, or method definition. Such a docstri... on strings** that are used in the class, module, function, and method definition in order to provide information about the functionality of a larger piece of code in a **prescr... help programmers (including you) to remember and understand the purpose, operation, and capabilities
- 3.1 PEP 8 – Introduction @info:cursos:pue:python-pcpp1:m2
- y recommended reading, as they help you to better understand the philosophy behind Python and become a... more important. Consistency within one module or function is the most important. [...] However, know w... t of the code. (However, this may be a good opportunity to rewrite the code and make it PEP 8 complian... le conventions. These tools can be installed and run locally, or accessed online. We want to show you
- 4.1 Shallow and deep copy operations @info:cursos:pue:python-pcpp1:m1
- ject: label vs. identity vs. value; * the id() function and the is operand; * shallow and deep cop... ithout making use of variables. As variables are fundamental elements that allow us to cope with objec... lue and label not enough? The built-in ''id()'' function returns the 'identity' of an object. This is an integer which is guaranteed to be unique and constant for this object during its lifet
- 2.1 PEP 20 – The Zen of Python @info:cursos:pue:python-pcpp1:m2
- to the Python programming language and Python community, wrote this 19-line poem on the Python mailing... o to the editor window, type in ''import this'', run the code, and voilà! Can you see what happens? W... it. Maybe there’s a better way to implement the functionality. If not, think about leaving a comment ... ng on so that other programmers find it easier to understand your code. In Python, it’s preferred to
- 1.7 Four magic letters: CRUD @info:cursos:pue:python-pcpp1:m4
- cts and tools and glue all these pieces into one functional block. You already know how HTTP works, how it’ is mounted on top of the TCP stack and how the HTTP serve... us than just store and publish fancy images and funny videos. In fact, a properly trained web server... chnologies can utilize shared data through one, **universal interface**. The interface itself enables
- 2.3 A small lexicon of widgets - Part 3 @info:cursos:pue:python-pcpp1:m3
- as it’s full equipment is extremely complex. Fortunately, we don’t need its entire flexibility when w... d, as the widget doesn’t take the focus itself. Run the code and test its behavior. <code python> im... lick) causes one of **two effects**: * **it launches** a callback bound to the option; * **it unrolls** a new menu (actually a submenu) * if you
- 1.1 Python Professional Course Series: RESTful APIs @info:cursos:pue:python-pcpp1:m4
- **S** stands for State. The word state is key to understanding what REST is and what it could be used... t. The history of sockets started in 1983 at the University of California in Berkeley, where the conc... on was carried out. The resulting solution was a universal set of functions suitable for implementation in nearly all operating systems and available in
- 2.3 Extended function argument syntax @info:cursos:pue:python-pcpp1:m1
- = 2.3 Extended function argument syntax When we talk about function arguments, we should recall the following facts: * some functions can be invoked without arguments; * functions may require a specific number of arguments with
- 5.1 Metaprogramming @info:cursos:pue:python-pcpp1:m1
- dify their own or other programs’ codes. It may sound like an idea from a science fiction story, but t... e'll touch on the “deeper magic” in a benign way. Understanding Python metaclasses is worthwhile, because it leads to a better understanding of what is happening under Python's hood when classes are created. In Python, a metaclass
- 1.6 Events and how to handle them @info:cursos:pue:python-pcpp1:m3
- ts. This also means that some of the events may launch some of your callbacks, which makes you respons... on a very helpful method we’ll use to arrange communication between you and your application. Of course, you can use the regular ''print()'' function to show messages and present a debug trace. ... the application to behave in a mature way. The function we’ll use for our experiments is named ''sho
- 4.2 Serialization of Python objects using the pickle module @info:cursos:pue:python-pcpp1:m1
- of Pythonistas. So, what can be pickled and then unpickled? The following types can be pickled: *... ts (remember to avoid cycles!) * references to functions and classes, but not their definitions. Le... ning a string, an integer, and a list. When you run the code presented in the right pane, a new file should be created. Remember to run the code locally. <code python> import pickle a_
- 1.6 Making life easier with the requests module @info:cursos:pue:python-pcpp1:m4
- inal stage of our journey – we know enough to communicate with the web service using JSON as an information carrier. Unfortunately, our knowledge needs to be supplemented – we need a **server serving** a web **service** (... gn. The socket module is perfect when you want to understand network issues at the TCP level and to le
- Python Professional Course Series: GUI Programming @info:cursos:pue:python-pcpp1:m3
- re that GUI is present nearly everywhere. Look around you – you’ll see a couple of different devices e... re every year) use it to display a GUI and to communicate with the user. They communicate bidirectionally. GUI stands for Graphical User Interface. In th... phical? We have to do a little time traveling to understand that. Don’t worry, it won’t take long. We