GithubHelp home page GithubHelp logo

color formating of the output about qtconsole HOT 3 OPEN

lorcat avatar lorcat commented on July 22, 2024
color formating of the output

from qtconsole.

Comments (3)

ccordoba12 avatar ccordoba12 commented on July 22, 2024

Hey @lorcat, thanks for reporting. I don't understand what you mean by this

I would like to have a control of custom color text output of the commands

Could you post a screenshot to better understand your point?

from qtconsole.

wmvanvliet avatar wmvanvliet commented on July 22, 2024

This is how I understood the question:

In the terminal, one can use the special ANSI color codes (e.g. \e[1;31m) to set the current color of the text. You can use this to add colors to your text output. Does QtConsole support ANSI?

I think QtConsole does support ANSI codes to some degree. For example, this works:

print("\033[1;32;40m Bright Green  \n")

To work more easily with colors, python ships with the colorama module. Try this:

import colorama
from colorama import Fore
# strip=False disables some windows specific conversion that qtconsole doesn't support
colorama.init(strip=False)
print(Fore.GREEN + 'This text is in green')

from qtconsole.

lorcat avatar lorcat commented on July 22, 2024

Hi! Sorry for the late response. Yes, the question would be - is there a way to control color output of the text within the qtconsole similar to what is done in linux terminal.

I see that stuff output within logging.error() or warning is highlighted in red, info() comes in blue.

Can we control individual colors like here:
pic

from qtconsole.

Related Issues (20)

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.