Cerca
Heus ací els resultats de la cerca.
Resultats de text complet:
- 4.1 Logging in Python @info:cursos:pue:python-pcpp1:m5
- = 4.1 Logging in Python == Logging in Python The Python Standard Library provides a useful module called ''logging'' to log events occurring in the application. Logs are most often used to find the cause of an e
- 1.7 Four magic letters: CRUD @info:cursos:pue:python-pcpp1:m4
- interface provided to the user (you) will always look the same. We can say that that's what REST was... ain. We’re ready to start now. Open the console, locate the directory where your cars.json is located and launch the server: <code bash>json-server --wat... t) document, which is completely useless to us. Look at the code in the editor. It's very basic so f
- 2.9 Inheriting properties from built-in classes @info:cursos:pue:python-pcpp1:m1
- we focus on the problem and not on type control. Look at the code presented in the editor pane. <cod... built-in dictionary, which will be equipped with logging mechanisms for details of writing and readin... super().__init__(*args, **kwargs) self.log = list() self.log_timestamp('MonitoredDict created') def __getitem__(self, key):
- 1.6 Making life easier with the requests module @info:cursos:pue:python-pcpp1:m4
- d**. It's too choosy and too powerful. It exposes lots of details which aren't necessary available at ... ox** for us, and we don't want to persuade you to look inside it. Okay. Let's start. First of all, w... un the Windows installer (a file with a name that looks like ''node-vxx.yy.z-x86.msi'') from the LTS //(Long Time Support//) branch; accept all the default
- 3.1 PEP 8 – Introduction @info:cursos:pue:python-pcpp1:m2
- conventions. These tools can be installed and run locally, or accessed online. We want to show you jus... ur coding experience better and your life a whole lot easier. As stated before, the way you write your... (i.e., spaces and tabs) at the beginning of each logical line, is used to group statements. When wri... == Continuation lines Continuation lines (i.e., logical lines of code that you want to split because
- 4.1 PEP 257 – Docstring Conventions @info:cursos:pue:python-pcpp1:m2
- ntually between commenting and documenting code? Look at the table below, where we want to show you s... g program execution (i.e. they can be accessed by looking at the source code).|Docstrings can be acces... d end with a full stop. If you need to include a longer comment in your code, you can use a multiple-... accepts, or the type of the value it will return. Look at the following examples: <code python># No ty
- 5.1 The configparser module @info:cursos:pue:python-pcpp1:m5
- ices requires authentication using data such as a login and password, or simply an access token. Each... his is done? == What does the configuration file look like? The structure of the configuration file i... n '';'' or hash ''#'': <code ini>[DEFAULT] host = localhost # This is a comment. [mariadb] name = hel... lenames that have been successfully parsed. Let's look at the code in the editor to see how to parse t
- 1.2 How to use sockets in Python @info:cursos:pue:python-pcpp1:m4
- Because** there can be more than one HTTP server located at the same IP address** - the server you wi... onnected to its counterpart on the server's side. Look at the code in the editor - this is how we perf... pecific for the INET domain**. Don't expect it to look the same in other domains. You may ask - why 8... ion attempt will fail? Of course it is. There are lots of possible reasons: a malformed address of the
- 1.1 SQLite @info:cursos:pue:python-pcpp1:m5
- n your account data, consisting of email address, login, and password, and when you add new posts you ... regardless of the operating system used, has its location (a path to a specific disk space). When you... n your current working directory, or in any other location. To create a database, use the ''connect'' ... se only if it cannot find a database in the given location. If a database exists, SQLite connects to i
- Python Professional Course Series: GUI Programming @info:cursos:pue:python-pcpp1:m3
- l the more that GUI is present nearly everywhere. Look around you – you’ll see a couple of different d... ng to understand that. Don’t worry, it won’t take long. We’re going to travel not more than fifty year... u ready? Okay, let’s go! == Terminals For a very long time (about 30 years or even longer) displays weren’t treated as a part of computers. A computer (s
- 1.2 Let TkInter speak! @info:cursos:pue:python-pcpp1:m3
- hing** the event controller. That’s all. Really. Looks too good to be true? Let us show how it works.... tkinter’s components. If you don’t like to write long package names each time you make use of their c... its original name) at the time of import. **tk** looks shorter than **tkinter**, doesn’t it? <code p... life into it soon – it's only a very first step. Look at the code in the editor. <code python> impor
- 2.1 PEP 20 – The Zen of Python @info:cursos:pue:python-pcpp1:m2
- ts guiding principles, and design. Tim Peters, a long time major contributor to the Python programmin... lement in your code. These, of course, should be looked upon holistically, rather than individually, ... though you can actually have any level of nested loops or if statements in Python, **anything above t... t of code, don’t write lines of code that are too long, use whitespaces responsibly – this all affects
- 1.3 Settling widgets in the window's interior @info:cursos:pue:python-pcpp1:m3
- . It forces you to **precisely declare a widget's location**, pixel by pixel. It won't, however, prote... y to guess your intentions and to **find the best location** for each widget. Unfortunately, its assum... ike order**. Try to guess what these buttons will look like inside the window. Yes, this is what we ex... play with ''width'' and ''height'' for a moment. Look, we've added some arguments to the previous sni
- 1.1 Python Professional Course Series: RESTful APIs @info:cursos:pue:python-pcpp1:m4
- Some words about REST The word you see below may look a little enigmatic: REST Are we going to convi... chinery (do not take this literally) which drives lots of contemporary computer systems, especially th... sentational * **S**tate * **T**ransfer Let's look at them separately. === Representational **RE... where else, not on your computer, but on a server located over the hill and far away. Of course, you c
- 1.4 Talking to JSON in Python @info:cursos:pue:python-pcpp1:m4
- python-pcpp1:m4:pasted:20240112-030457.png }} It looks simple and consistent. So where’s the trap? ... ring and to turn it into Python data** is named ''loads()'' – it takes a string (hence the s at the en... ort json jstr = '16021766189.98' electron = json.loads(jstr) print(type(electron)) print(electron) </... ut> <class 'float'> 16021766189.98 </code> The ''loads()'' function is able to cope with **strings**,