【发布时间】:2016-03-27 22:37:24
【问题描述】:
我正在尝试更改某行文本的颜色。 我看过其他文章(包括Change shell print color in python 3.3.2),但没有任何工作。 如果可能的话,我不想安装任何外部模块。
我的代码:
from subprocess import call
call('color a', shell=True) #this sets the color to light green
print('The quick brown fox jumps over the lazy dog.')
我在 Linux 上使用 Python 3.2.3。 感谢您的任何回复。
【问题讨论】:
-
@Dylan,它给了你什么错误:
/bin/sh: 1: color: not found?你用的是linux还是windows? -
我目前正在使用 Linux。
-
@DylanMurphy 它显示您运行代码时出现什么错误?