我在Python中尝试Colorama,我导入了Colorama,然后启动了它,因为我使用的是64位Windows 7。但不知怎的,在从Colorama导入前、后、样式之后,当我在命令提示符下运行该程序时,它显示了-Import错误,表示“无法从Colorama导入名称'Fore'”! 我给出了我键入的代码和屏幕截图,以及从命令提示符中得到的错误。 :-)
> Code:
import colorama
from colorama import Fore, Back, Style
colorama.init()
print(Fore.RED + 'some red text')
print(Back.GREEN + 'and with a green background')
print(Style.DIM + 'and in dim text')
print(Style.RESET_ALL)
print('back to normal now')
Error in the command prompt
(base) PS *** python colorama.py
Traceback (most recent call last):
File "colorama.py", line 1, in <module>
import colorama
File ***, line 2, in <module>
from colorama import Fore, Back, Style
ImportError: cannot import name 'Fore' from 'colorama' ***
星号(*)屏蔽目录
目前没有回答
相关问题 更多 >
编程相关推荐