python33, windows, UnicodeEncodeError: 'charmap' codec can't encode characters in position, to print out the file contents to stdout,

Dave Angel davea at
Sun Jul 6 14:57:58 CEST 2014

gintare <g.statkute at> Wrote in message:
> The answer is on page:
> The correct code:
> f=open('C:\Python33\Scripts\lang\langu\svtxt.txt','r', encoding='utf-8')
> linef=f.readlines()
> print(repr(linef))

But naturally the path should be fixed as well. Either use forward
 slashes,  escape the backslashes,  or use a raw string.

f=open( r'C:\Python33\Scripts\lang\langu\svtxt.txt','r',


More information about the Python-list mailing list