I have a file with words in lines, ex
А
б
Вв
Гг
(non-latin letters) etc.
I want to get this:
А
Б
ВВ
ГГ
while after the code runs I see no changes
here is code:
f = open('sample.csv')
for line in f:
for sampleword in line.split():
print sampleword.upper()
Non-latin characters are not capitilized. What's the problem?
Solution for capitalizing non-latin letters in Python 2 is to use unicode strings:
To read unicode from file you may refer to official Python manual: