Is there a single python module for colored text output in idle, Powershell and terminal?

狂风中的少年 提交于 2021-01-29 20:59:37

问题


I need a python module that prints a colored output text for input() and print() functions which works on idle, Powershell, and Linux consols.

I am just expecting few colors (no extra background features required) and the same functions should work equally on python idle, PowerShell, terminal, and cmd with full flexibility of code.


回答1:


You can use 'clrprint' module which works for idle, terminal and PowerShell too

pip install clrprint

from clrprint import *
clrhelp() # print's available colors and usage

user_input = clrinput("input please: ",clr='r') # just like input() [color is red]
clrprint('your text',user_input,clr='green') # just like print() 

Take a look at https://github.com/AbhijithAJ/clrprint for more info and screenshots.



来源:https://stackoverflow.com/questions/62933340/is-there-a-single-python-module-for-colored-text-output-in-idle-powershell-and

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!