J
J
Jairman2020-01-27 17:49:31
Django
Jairman, 2020-01-27 17:49:31

How to work with Russian letters in python?

The notepad contains the text: "Glock-18 | Night (Well-Worn):". If you read it in python

inputfile = 'PATH'
    info = open(inputfile, mode = 'r')
    for line in buyordersfile:
        linetemp = ''
        temp = 0
        for i in range (0, len(line)):
            if line[i] == ':':
                temp = i + 1
                break
            else:
                linetemp += line[i]
        print(linetemp)

Output: Glock-18 | Ночь (Поношенное)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kova1ev, 2019-04-29
@turdubekov

in the code correct for models.Text Field

I
Ivan Yakushenko, 2020-01-27
@Jairman

open(inputfile, mode = 'r', encoding='utf-8')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question