GithubHelp home page GithubHelp logo

msgterm's Introduction

Descripción

Clase para mostrar mensajes en el terminal con diferentes estilos.

Se ayuda de la librería termcolor para mostrar los textos en color y con otros estilos.

Características

Se pueden mostrar mensajes personalizados o usar los ya definidos en la clase:

  • debug: mostrar mensajes de depuración
  • info: mostrar información al usuario
  • text: mostrar textos
  • success: mostrar mensajes de éxito
  • warning: mostrar advertencias al usuario
  • alert: mostrar alertas al usuario
  • error: mostrar errores
  • fatal: mostrar errores fatales
  • help: mostrar mensajes de ayuda al usuario

Ejemplos:

MsgTerm.verbosity(MsgTerm.DEBUG)  # Set level of verbosity
MsgTerm.message('Text messages')
MsgTerm.debug('debug')
MsgTerm.info('info')
MsgTerm.text('text')
MsgTerm.success('success')
MsgTerm.warning('warning')
MsgTerm.alert('alert')
MsgTerm.error('error')
MsgTerm.fatal('fatal')
MsgTerm.help('help')

# Print a list of messages in paragraph style
MsgTerm.message('Paragraph Style', label='#', bold=True, hr=True, type=MsgTerm.SUCCESS)
msgs = ['This is a message', 'that to show in multiple lines', 'like as a paragraph style']
MsgTerm.message(msgs, paragraph=True, label=' ', bold=True, type=MsgTerm.INFO)

Se puede definir el nivel de verbose que se quiere mostrar en pantalla:

MsgTerm.verbosity(MsgTerm.ALERT)

Dependencias

  • termcolor

    Instalar

    pip install termcolor

msgterm's People

Contributors

nicoalonso avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.