M
M
Maxim2015-10-29 15:12:37
Python
Maxim, 2015-10-29 15:12:37

How to convert Russian names into a readable form?

Hello. Started working with openpyxl. Page titles in Russian. How to convert them into Russian?
I started with this code.
from openpyxl import load_workbook
wb2 = load_workbook('rto.xlsx')
print wb2.get_sheet_names()
for i in wb2.get_sheet_names():
print i.encode('ascii', 'ignore')
C:\Python27\python.exe ~/converting.py
[u'\u043c\u0430\u043a\u0441\u0438\u043c', u'\u041b\u0438\u0441\u04422', u'\u041b\u0438\u0441\u04423']
sheet name:
sheet name: 2
sheet name: 3
Process finished with exit code 0
Where the page name should be in Russian, we get an empty string. What to do?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
JRazor, 2015-10-29
@JRazor

Read this

M
Maxim, 2015-10-29
@maximtop

When I sent it to print, I had to remove .encode('ascii', 'ignore')
And everything seemed to work by itself. I'll keep looking into coding.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question