lectura | index /home/manager/prog-python/test_fundamentos/fundamentos/lectura.py |
Paquete fundamentos
Conjunto de módulos para hacer entrada/salida sencilla en Python
Copyright (C) 2019
Universidad de Cantabria, SPAIN
Versión 1.1
Marzo 2019
@author: Michael Gonzalez <mgh@unican.es>
Licencia: GPL
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
-----------------------------------------------------------------------
lectura.py: Módulo con una clase que permite leer datos
de una ventana
-----------------------------------------------------------------------
--------------------
-- Ejemplo de uso --
--------------------
from fundamentos.lectura import Lectura
def main():
# Paso 1: crear el objeto de la clase Lectura
lec = Lectura("Datos del experimento")
# Paso 2: crear las entradas para leer datos
lec.crea_entrada("Número de secuencia", 1)
lec.crea_entrada("Voltaje (V)", 0.0)
lec.crea_entrada("Nombre del técnico", "Pedro")
# Paso 3: esperar a que el usuario teclee
lec.espera()
# Paso 4: leer los valores tecleados
sec: int = lec.lee_int("Número de secuencia")
volt: float = lec.lee_float("Voltaje (V)")
nombre: str = lec.lee_string("Nombre del técnico")
# Usar los valores obtenidos
...
# Paso final: destruir la ventana
lec.destruye()
Modules | ||||||
|
Classes | ||||||||||
|
Data | ||
Dict = typing.Dict E = 'e' List = typing.List SUNKEN = 'sunken' |