There is such a code:
from time import sleeep
Word = ""
Words = []
DATA = OPEN ('DICT.TXT', 'R')
d = str (data.read ())
Print (D)
for sym in d:
# Print (SYM)
IF Sym == ',':
Print (Word)
Words.APPEND (Word)
Word = ""
ELIF Sym == ".":
Print (Word)
Words.APPEND (Word)
Break
ELSE:
Word = Word + Sym
For w in Words:
Print (W)
Sleep (0.7 * Len (w))
and .txt Document with defined Russian words written through the comma and space. When I start the script instead of Russian characters, this is:
їWITHђіμWITH ,, їѕє°.
їWITHђіμWITH,
їѕє°
їWITHђіμWITH,
їѕє°
What should I do to show words in Russian, instead unknown what?
Answer 1, Authority 100%
Let’s look at the scheme from the article “How to recognize krakoyarbra? “:
We see that it is UTF-8, decoded as Win-1251.
Indicate the correct encoding when you open the file
data = open ('dict.txt', 'r', encoding = 'utf-8')
Voila.