[ Level 1 ] How ansi color in terminal by Python script.

Sample for show ansi color in terminal by Python script.
#!/bin/env python
import os
print os.popen('echo "\033[31m\033[43mHello World!\033[0m"').read()
print '\033[31m\033[43m' + 'Hello World!' + '\033[0m'

Wish this helps.

regards,
Stanley Huang

Comments

Popular posts from this blog

[Level 1] Rar tool for Solaris.

[Level 2] iif in Python