改变Python文本的颜色

时间:2015-12-21 19:12:03

标签: python colors passwords

我正在尝试更改某一行文字的颜色。 我查看了其他文章(包括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。 感谢您的回复。

1 个答案:

答案 0 :(得分:0)

我认为你使用的方式是针对Windows。

您可以使用src

For i = 1 To counter 
'counter is the number of matches I want to find
    For Each cell In Range("C4:C" & LastRow)
'dateArray contains the timestamps to be matched
        If cell.Text = dateArray(i) Then
            Sheets("AlarmData").Range("BA" & cell.Row).Copy
            Sheets("Sensor_HWare_Alarms").Range("R" & i).PasteSpecial
            Exit For
        End If
    Next cell
Next

您也可以使用列出的here颜色格式代码,使用它们:

termcolor

输出就像:

enter image description here