我的程序中有以下代码行,它执行得很好,没有问题,但是当我尝试稍微更改代码以用彩色打印输出文本时,它不起作用。我确定这是一个语法问题,如果有人可以帮忙,那就好了
from termcolor import colored, cprint
print("Name of the table:",table)
print("printing all the column names of this table:\n", df1_columns.columns)
print("count number of columns in this table: ",len(df1_columns.columns))
我将以上内容更改为以下内容并引发错误
print(colored("print name of the table:"),table,'blue')
print(colored("print all the column names of this table:\n",df1_columns.columns,'blue')
print(colored("print number of columns in this table: ",len(df1_columns.columns,'blue'))