exercice
Popularity
500+ learners.
- Examples
Los métodos están declarados dentro de la clase exercice, y son de hecho funciones. | The methods are declared inside the class exercice, and are in fact functions. |
En nuestro ejemplo (ver el archivo templateExercice.py, queremos definir varios objetos de tipo exercice. | In our example, (see the file templateExercice.py), we would like to define many objects of the type exercice. |
De la misma forma que el objeto exercice, el objeto labelExercice se halla en su propio archivo, labelExercice.py. | In the same way as the object exercice, the object labelExercice is put in it's own file, labelExercice.py. |
Ejercicio con una clase padre En nuestro ejemplo (ver el archivo templateExercice.py, queremos definir varios objetos de tipo exercice. | In our example, (see the file templateExercice.py), we would like to define many objects of the type exercice. |
Además, como este objeto es hijo del objeto exercice, necesitamos decirle cómo está definido el padre. | Next, since this object is a child of the object exercice, we need to tell it how the parent is defined. |
Esto significa literalmente que la definición de la clase exercice in el archivo templateExercice.py se importa al código actual. | This literally means that the definition of the class exercice in the file templateExercice.py is imported in the current code. |
Vamos ahora con el aspecto más importante, la declaraciónd de la clase labelExercice como una clase hija de exercice. | We come now to the most important aspect, the declaration of the class labelExercice as a child class of exercice. |
Ahora modifique el circuito para crear el exercice suprimiendo algunos alambres, modificando el arreglo de los componentes o del cableado. | Modify the circuit now to create the exercice by deleting some wires, modifying the arrangement of the components or the wiring. |
Estos tipos derivados de ejercicios tendrán al menos los mismos atributos y métodos que la clase exercice porque los heredarán. | These derived types of exercises will have at least the same attributes and methods as the class exercice because they will inherit them. |
Solo llamamos a métodos definidos en la clase base abstracta exercice, y ellos hacen diferentes cosas en las clases colorExercice o labelExercice. | We only call methods defined in the abstract base class exercice and they do different things in class colorExercice or labelExercice. |
Definimos un objeto de tipo exercice para que actúe como clase base abstracta para derivar otros ejercicios que crearemos más tarde. | We define an object of type exercice to serve as an abstract base class for deriving other exercises that we will create later. |
Sabiendo wue el atributo exerciceWidget contiene el widget del ejercicio, solo es necesario llamar a área.add (self.exerciceWidget) para empaquetar el exercice en Drill. | Knowing that the attribute exerciceWidget contains the exercise's widget, one need only call area.add (self.exerciceWidget) to wrap the exercice in Drill. |
Esto nos permitirá manipular los diversos tipos de objetos exercice de forma idéntica, sin tener en cuenta el objeto desde el que son instanciados. | This will permit us to manipulate all the diverse types of exercice objects identically, regardless of the object they are instantiated from. |
De hecho, no es necesario crear una instancia de la clase exercice porque solo es una plantilla desde la cual se derivan otras clases. | In fact, there's no need to create an instance of the class exercice because it's only a template from which other classes are derived. |
Dado que todos los ejercicios son hijos de la clase exercice, usamos sus métodos de la misma forma para controlar los ejercicios en toda su variedad. | Given that all the exercises are children of the class exercice, we use its methods the same way to control the exercises in all their variety. |
Además, este widget debe ser referenciado en el atributo exerciceWidget para que no tengamos que sobrecargar los métodos activate y unactivate de la clase padre exercice. | Also, this widget must be referenced in the attribute exerciceWidget so we will not need to override the activate and unactivate methods of the parent class exercice. |
Random Word
Roll the dice and learn a new word now!
Want to Learn Spanish?
Spanish learning for everyone. For free.
