Quote:
Originally Posted by Sane
Wow. Are you sure? I've seen in a console window, on Windows, different colors for different lines before. It was written in C.
|
You mean this old thing:
#include <stdio.h>
#include <windows.h>
int main(void)
{
HANDLE hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
WORD wAttributes;
CONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo ;
// save current text and backgroud colors
GetConsoleScreenBufferInfo(hConsoleOutput, &lpConsoleScreenBufferInfo);
wAttributes = lpConsoleScreenBufferInfo.wAttributes;
// set new text and background colors
SetConsoleTextAttribute(hConsoleOutput, FOREGROUND_RED | FOREGROUND_INTENSITY);
printf("Hello World! in colorful C\n");
// restore origional text and background colors
SetConsoleTextAttribute(hConsoleOutput, wAttributes);
getchar(); // wait
return 0;
} Sure, you can use the Windows API functions in Python. Just get the Win32 extension package.