|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Color Console Output
Does any1 know how to produce colored console output wo/ using ncurses or similar?
|
|
#2
|
|||
|
|||
|
i'm pretty sure you can use escape sequences to do what you're wanting to do, never done it though.
|
|
#3
|
||||
|
||||
|
There's a module packaged with Gentoo that lets you do it (which I mistakenly put into my app QuickRip thinking it was a standard lib!). I've attached it to this message. You can then just do:
Code:
import output
print output.green("hello")
|
|
#4
|
||||
|
||||
|
Windows
Just messing around with output.py, have to point out that this will not work on windows simply because linux and windows consoles work differently, instead of printing a new color in windows it simple prints the color code followed by the content and the color codes escape sequence, which in linux would cause colored output.
I dont know if it is possible to get colored output on windows, but if somone takes the time to write the modules i'm sure that this would be included in the Python standard lib! glad that you found it telex, Mark. Last edited by netytan : July 10th, 2003 at 07:53 PM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Color Console Output |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|