Cerca
Heus ací els resultats de la cerca.
Resultats de text complet:
- 2.3 A small lexicon of widgets - Part 3 @info:cursos:pue:python-pcpp1:m3
- racer remembers its **previous** state (using the last_s variable) and restores the field to this stat... kinter as tk def digits_only(*args): global last_string string = text.get() if string ==... g.isdigit(): # Field's content is valid. last_string = string else: text.set(last_string) last_string = '' window = tk.Tk() text =
- 1.6 Events and how to handle them @info:cursos:pue:python-pcpp1:m3
- ents. This also means that some of the events may launch some of your callbacks, which makes you respo... nfo("Click!","I love clicks!") window = tk.Tk() label = tk.Label(window, text="Label") label.pack() button = tk.Button(window, text="Button", command=click) butto
- 1.5 A simple GUI application @info:cursos:pue:python-pcpp1:m3
- lutely **obvious** – we'll construct a window and launch an event controller – look at the code in the... this dull gray area. Our new friend is called ''Label'' – a non-clickable widget able to **present s... nstructor using a ''text'' argument. The text can later be changed at any moment of the widget's life.... e python> import tkinter as tk window = tk.Tk() label = tk.Label(window, text = "Little label:") lab
- 2.2 A small lexicon of widgets - Part 2 @info:cursos:pue:python-pcpp1:m3
- e ''bind()'' to simulate similar behavior. The ''Label'' widget displays some lines of text inside the window: <code python> label = Label(master, option, ...) </code> The ''Label'' widget contains two usable properties, but you need to
- 1.7 Visiting widgets’ properties @info:cursos:pue:python-pcpp1:m3
- resenting a piece of text (e.g., ''Button'' and ''Label'' but not ''Frame'') can be made to use a font... s – obviously – named ''font''. We’ve used the ''Label'' widget to demonstrate three different fonts.... e python> import tkinter as tk window = tk.Tk() label_1 = tk.Label(window, text="Quick brown fox jumps over the lazy dog") label_1.grid(column=0, row=0)
- 2.1 PEP 20 – The Zen of Python @info:cursos:pue:python-pcpp1:m2
- time major contributor to the Python programming language and Python community, wrote this 19-line po... enever you want to use an implicit feature of the language, ask yourself whether you really need it. M... over a simple one, especially in the case of the latter causing misunderstanding, doubt, or misinterp... possible benefits (e.g., better performance) are larger than the possible negative effects (e.g., aff
- 3.1 Advanced techniques of creating and serving exceptions @info:cursos:pue:python-pcpp1:m1
- Error: list index out of range </code> Sooner or later, every Pythonista will write a code that raise... in the object. * **end** – the index after the last invalid data in the object. See the output of ... xception object in a handy and consistent way for later processing like logging, etc. Look at the fol... an exception or error in most of the programming languages): <code ; output> Traceback (most recent c
- 4.1 PEP 257 – Docstring Conventions @info:cursos:pue:python-pcpp1:m2
- conventions**, best practices, and semantics (not laws or regulations!) associated with documenting Py... provide information about the functionality of a larger piece of code in a **prescriptive** way. The... that may come up in the development process, and label specific names with type information. In a nu... elated information in docstrings, you can use the language itself to serve this purpose. This may be a
- 1.2 How to use sockets in Python @info:cursos:pue:python-pcpp1:m4
- get domain has to be known at the moment; * the latter argument is a socket type code (we may use th... WWW site. Of course, we'll tell you more about it later. A conversation with the HTTP server consists... kay, we know now that HTTP won't be our favourite language, but how we can send such a request to the ... extremely complicated - it engages not only many layers of the OS, but also lots of network equipment
- 1.2 Working with class and instance data – instance variables @info:cursos:pue:python-pcpp1:m1
- tialization, performed by the __init__ method, or later at any moment of the object's life. Furthermor... return message class FixedPhone(Phone): last_SN = 0 def __init__(self, number): super().__init__(number) FixedPhone.last_SN += 1 self.SN = 'FP-{}'.format(FixedPhone.last_SN) class MobilePhone(Phone): last_SN = 0
- 4.1 Shallow and deep copy operations @info:cursos:pue:python-pcpp1:m1
- s. Specifically, you'll learn about: * object: label vs. identity vs. value; * the id() function ... * finally a variable, which you should treat as a label or name binding, is created, and this label refers to a distinct place in the computer memory. Wh... t object 'identity'? Why are the object value and label not enough? The built-in ''id()'' function re
- 1.1 SQLite @info:cursos:pue:python-pcpp1:m5
- : Oracle Database, Microsoft SQL Server, IBM DB2 Later in this course, we'll focus mainly on the SQLi... me knowledge of SQL. SQL is a **Structured Query Language** for creating, modifying, and managing rel... SQL, PostgreSQL, and our favorite SQLite. The SQL language was developed in the 70s by IBM. Over the y... or this purpose, we’ll use the ''TEXT'' type. The last column called priority defines the priority of
- 2.2 Inheritance and polymorphism — Inheritance as a pillar of OOP @info:cursos:pue:python-pcpp1:m1
- ays true, but we'll discuss this issue more a bit later. {{ :info:cursos:pue:python-pcpp1:pasted:2023... ere: <code python>class Vehicle: pass class LandVehicle(Vehicle): pass class TrackedVehicle(LandVehicle): pass</code> All the presented cla... *Vehicle** class is the superclass for both the **LandVehicle** and **TrackedVehicle** classes; * th
- 4.2 Serialization of Python objects using the pickle module @info:cursos:pue:python-pcpp1:m1
- you will learn how to persist Python objects for later use. **Pickling** is the process of preservin... red saving the output of your data processing for later use? The simplest way to persist outcomes is ... module, you can 'pickle' your Python objects for later use. The 'pickle' module is a very popular an... ckle module: <code python> import pickle </code> Later you can see that the file handle 'file_out' is
- 3.1 The CSV module in Python @info:cursos:pue:python-pcpp1:m5
- 101 father,222-555-102 wife,222-555-103 mother-in-law,222-555-104 </code> In the above file, there ar... 222-555-102'] ['wife', '222-555-103'] ['mother-in-law', '222-555-104'] </code> What happened? We've p... 101 father,222-555-102 wife,222-555-103 mother-in-law,222-555-104 </code> **NOTE**: The ''newline=%%'... father : 222-555-102 wife : 222-555-103 mother-in-law : 222-555-104 </code> == Reading data from a CS