-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
color formating of the output #558
Comments
Hey @lorcat, thanks for reporting. I don't understand what you mean by this
Could you post a screenshot to better understand your point? |
This is how I understood the question: In the terminal, one can use the special ANSI color codes (e.g. I think QtConsole does support ANSI codes to some degree. For example, this works:
To work more easily with colors, python ships with the 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') |
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. |
The output behavior in qtconsole depends on the selected syntax style. To ensure consistent parsing and formatting of output, you can generate output via the print function. For example, you can format your text with ANSI escape codes like this: This method allows you to control the appearance of the text in the console. Additionally, various PRs have been developed, for example to achieve the correct yellow color with ansi codes and to further expand the color standardization when selecting a style in qtconsole(Use selected syntax style for tracebacks and improve ANSI color codes support by jsbautista · Pull Request #608 · jupyter/qtconsole (github.com)). |
Hi! Many thanks for qtconsole. Myself and our users are using it almost every day.
There is one thing I would like to ask, maybe there is a way, but I could not find it in documentation.
I would like to have a control of custom color text output of the commands. If in linux terminal one could use special \e[1;31m
In qtconsole I do not see a simple way. Could someone guide me here?
The text was updated successfully, but these errors were encountered: