![]() |
Different Colors In Console Output
Quote:
I am running Python 2.4 on Windows. How can I display console output in a different color? All the solutions I find are Unix only. I know how to do it in C, but not Python. So I know it must be possible. If it isn't, I'll just use wxWidgets. Thanks for any help. |
Have you downloaded the win32 api extensions for python? Im not positive this is it because I haven't downloaded it in a while but after a quick google I think this is it.
https://sourceforge.net/project/show...group_id=78018 |
Nice to see you back:
[PHP]# change color in the console display (Windows) # color is a two digit hexadecimal number # the first digit is the background # the second digit is the foreground (text) # 0=black 1=blue 2=green ... to E=yellow F=white import os os.system("color F2") # green(2) text on white(F) background[/PHP]BTW, don't take DaWei serious, he is crude to most of us! |
@MicDareall:
Yes, I have.@Dietrich: Oh cool! The 16 color system! Brings back memories of Q-BASIC. :D |
No, I didn't make a post here. People just like to take arbitrary shots at me. I haven't lost as much as one second of sleep over it. The caliber of the detractors is too low. Glad to see you back, Sane.
|
Sorry Sane, that's just ye olde DOS command. Looks like you ought to use wxPython then.
|
Wow. Are you sure? I've seen in a console window, on Windows, different colors for different lines before. It was written in C.
|
Sure, you can write it in C/C++, for Windows. See the Console part of the API. If you want, I can pop you some code, but I thought you wanted to do it in Python, and I haven't researched that. A lot of people say "DOS" when they shouldn't (it's an acronym for Disk Operating System). It means nothing. It could be MSDOS or another OS or the Windows Command facility or the Windows CMD facility or any number of other things.
|
Quote:
:
#include <stdio.h> |
Aahh... so those are the win32api functions "MicDareall" was mentioning.
I haven't tried it, but I'm sure it'll work great. Thanks! :) |
| All times are GMT -5. The time now is 3:15 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC