Sparsil page, and she in this form: \ u0426 \ u0435 \ u043d \ u0442 \ u0440 I tried decode and encode, do not help, and if converts, then in Chinese characters символы 㐰 㘲 畜 㐰 㔳 畜 㐰 搳 畜 㐰 ㈴ 畜 㐰〴

How to transform a variable in which the code of the site into a readable form?

Closed due to the fact that the participants are not on topic: Sergey Gornostaev , MaxU , 0xdb , LFC , freim on Feb. 9 at 10:50 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • “Questions asking for help with debugging (“ why does this code not work? ”) Should include the desired behavior, a specific problem or error, and a minimum code for playing it right in the question . Questions without an explicit description of the problem are useless for other visitors. See How to create minimal, self-sufficient and reproducible example . " - Sergey Gornostaev, MaxU, 0xdb, LFC, freim
If the question can be reformulated according to the rules set out in the certificate , edit it .

    1 answer 1

    Try this:

    "\u0426\u0435\u043d\u0442\u0440".decode("unicode-escape") 
    • Many thanks - Mostalk
    • I had to go to Python3, and there he writes: AttributeError: 'str' object has no attribute 'decode', I tried to simply output, the text is still in Unicode - Mostalk
    • @Mostalk in python 3 all Unicode strings, no additional conversion is required, unicode-escape sequences are decoded implicitly by the means of python itself. - Sour Sourse pm
    • Then how to make the line readable if .decode ("unicode-escape") does not work? - Mostalk 3:19 pm
    • decode does not work because it does not have str objects. working with strings in python 2 and 3 is different. Ask a separate question. - Sour Sourse pm