Re: reading from file

2009-06-11 Thread Sydoruk Yaroslav
Jeff McNeil wrote: > Is the string in your text file literally "\xea\xe0\xea+\xef\xee > \xe7\xe2\xee\xed\xe8\xf2\xfc" as "plain text?" My assumption is that > when you're reading that in, Python is interpreting each byte as an > ASCII value (and rightfully so) rather than the corresponding '\x' >

Re: reading from file

2009-06-11 Thread Jeff McNeil
On Jun 11, 4:24 pm, Sydoruk Yaroslav wrote: > Hello all, > > In a text file aword.txt, there is a string: >     "\xea\xe0\xea+\xef\xee\xe7\xe2\xee\xed\xe8\xf2\xfc". > > There is a first script: > f = open ("aword.txt", "r") > for line in f: >     print chardet.detect(line) >     b = line.decode('c