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'
>
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
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('cp1251')
print b
_RESULT_
{'confidence': 1.0, 'encoding': '
On Jan 28, 10:06 am, Bruno Desthuilliers wrote:
> perfr...@gmail.com a écrit :
>
>
>
> > hi,
>
> > i am doing a series of very simple string operations on lines i am
> > reading from a large file (~15 million lines). i store the result of
> > these operations in a simple instance of a class, and t
perfr...@gmail.com a écrit :
hi,
i am doing a series of very simple string operations on lines i am
reading from a large file (~15 million lines). i store the result of
these operations in a simple instance of a class, and then put it
inside of a hash table. i found that this is unusually slow..
hi,
i am doing a series of very simple string operations on lines i am
reading from a large file (~15 million lines). i store the result of
these operations in a simple instance of a class, and then put it
inside of a hash table. i found that this is unusually slow... for
example:
class myclass(o