codecs latin1 unicode standard output file

Marko Faldix marko.faldix.tudisweck at mplusr.de
Mon Dec 15 11:04:04 CET 2003


Hello,

with Python 2.3 I can write umlauts (a,o,u umlaut) to a file with this piece
of code:

    import codecs

    f = codecs.open("klotentest.txt", "w", "latin-1")
    print >>f, unicode("My umlauts are ä, ö, ü", "latin-1")


This works fine. This is not exactly what I wanted to have. I would like to
write this to standard output so that I can use same code to produce output
lines on console or to use this to pipe into file. It was possible before
Python 2.3. Isn't possible anymore with same code?


--
Marko Faldix
M+R Infosysteme
Hubert-Wienen-Str. 24     52070 Aachen
Tel.: 0241-93878-16     Fax.:0241-875095
E-Mail: markopointfaldix at mplusrpointde






More information about the Python-list mailing list