menu | index /home/manager/prog-python/test_fundamentos/fundamentos/menu.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.
-----------------------------------------------------------------------
menu.py: Módulo con una clase que permite mostrar un menú con opciones
en una ventana, y obtener la opción elegida por el usuario
-----------------------------------------------------------------------
--------------------
-- Ejemplo de uso --
--------------------
from fundamentos.menu import Menu
def main():
menu_opciones = Menu("Elige una opción")
menu_opciones.inserta_opcion("Editar ficha de cliente")
... otras opciones
menu_opciones.inserta_opcion("Salir")
terminar: bool = False
while not terminar:
resultado: str = menu_opciones.espera()
... trabajar con la opción elegida
terminar = resultado.lower() in ("kill", "salir")
menu_opciones.destruye()
Modules | ||||||
|
Classes | ||||||||||
|
Data | ||
List = typing.List N = 'n' |