bash shell + python简单教程,让你的mac/linux终端灰起来~

前提条件:已经安装python,命令行支持bash

在bash_profile中添加

function ccolor {
python /Users/xirtam/Documents/tools/ccolor.py $1 $2 $3
}

编写其中的python文件

import sys
print(hex(int(sys.argv[1])<<16|int(sys.argv[2])<<8|int(sys.argv[3])))

然后将执行

source ~/.bash_profile

现在这个ccolor小工具就可以使用了~

posted @ 2015-08-11 17:35  带狗狗带  Views(581)  Comments(0Edit  收藏  举报