Windows XP unicode and escape sequences

"Martin v. Löwis" martin at v.loewis.de
Wed Dec 19 04:52:57 EST 2007


> This brings up another question.  If I run some Python code that
> starts off with 'os.system('cp869')' so it will change to the correct
> code page, then when it starts printing the Greek characters it
> breaks.  But run the same Python code again and it works fine.  Is
> there another way to do this so I can change over to the 869 code
> page and continue on with the Greek letters printing correctly?

You'll have to call SetConsoleOutputCP (see MSDN). Python does not
directly expose that, so you'll have to use ctypes or PythonWin to
call it.

Regards,
Martin



More information about the Python-list mailing list