开发者

Change printed text color in Idle?

开发者 https://www.devze.com 2023-03-22 13:34 出处:网络
Is there a way to specify the color a text is printed within Idle for Python 3.2? I\'m looking for 开发者_开发技巧something like:

Is there a way to specify the color a text is printed within Idle for Python 3.2?

I'm looking for 开发者_开发技巧something like:

print("foo", "#fafafa")
print("bar", "#4f4f4f")


http://docs.python.org/library/idle.html#syntax-colors

To change the color scheme, edit the [Colors] section in config.txt.

Edit: As you've edited your question, here is an edited answer. See

http://www.daimi.au.dk/~mailund/scripting2005/lecture-notes/process-management.html

for how to use terminal escape sequences in Python to change the color of things.

Will they work in IDLE? I don't know. But they will work in most terminals.

0

精彩评论

暂无评论...
验证码 换一张
取 消