Can't understand what's wrong with the encoding or what's going on in python?

vk bot returns the result, {body: somedata }
if you display to the console the result to the variable body produces here such


how to convert to human readable form??

I thought chatterbot does not perceive cirilicu, but there is support there for her as I understand it.
tried so
#if isinstance(msg, unicode):
 # message = msg.encode('utf8')
 #message = u".join(msg.encode('ascii', 'ignore').decode('ascii'))

and here and still falling

I'm a beginner in python and cant understand what the hell was going on already a head broke

In General, this result should be adopted chatterbot to answer but either he falls or vk bot falls with English words do not have this. all the answers and "learn"
June 8th 19 at 16:37
2 answers
June 8th 19 at 16:39
It all depends on the encoding in the console. In MS Windows is CP8665a74338159c0c928836062.png
But I suspect what you have is caused by feature of object serialization:5a74378a2a69d461547604.png
I have here a result. starts to annoy me that Python, to be honest. what am I doing wrong


the result
- geoffrey.Tillman commented on June 8th 19 at 16:42
and what is the console(system, program)? And that Python can even on Android to work.

Most likely the console encoding is ASCII which is not imee codes of Russian letters, so the Python string leads to such a mind.

The best solution is to use some sort of interface to output at least square Tk. - Iliana_Strosi commented on June 8th 19 at 16:45
generally the result goes into a chatterbot, and from it comes the answer of the bot, and this is exactly vk_api contact with vk and returns the result above.

all the machinations were made in the program PyCharm CE - geoffrey.Tillman commented on June 8th 19 at 16:48
in General, I realized that you have where instead of str(msg) is repr(msg) - where is the error in the linkage of the modules, it is necessary to check the whole code. Maybe don't set the main encoding to output strings. Easier on the other side to decode perhaps than to look where the dog is buried. - Iliana_Strosi commented on June 8th 19 at 16:51

explain to me as a beginner, and I have a whole brain broke th with this "roundnose" Python not

here is the entire code taken part with Habra. I as a novice do not understand what is wrong and why the VC server can not return a normal value strigulae why he gets the kind of rubbish that is not how to ukovernight

the entire project.
# -*- coding: utf-8 -*-
import time
import vk_api # <a href=""></a>
import from Talker Talker
import goslate
from pprint import pprint

vk = vk_api.VkApi(login='+37345934875', password='ksahUAu87Ays')

values = {'out': 0, 'count': 100, 'time_offset': 60}

def write_msg(user_id, s):
 vk.method('messages.send', {'user_id': user_id, 'message': s})

def read_msg():
 response = vk.method('messages.get', values)
 return response
talker = Talker()

while True:
 response = read_msg()
 answer = "
 if response['items']:
 msg = response['items'][0]['body']
 message = msg.encode('utf8')
 answer = talker.answerUser(message)
 if answer == "":
 answer = "OK"

 values['last_message_id'] = response['items'][0]['id']
 for item in response['items']:
 write_msg(item[u user_id'], answer)
 response['items'] = ""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
import goslate

class Talker(object):
 chatbot = ChatBot("max",

 def __init__(self):
 conversation = [
 "Hi there!",
 "How are you doing?",
 "I'm doing great.",
 "That is good to hear",
 "Thank you.",
 "You're welcome.",
 "what you want?",
 def answerUser(self, question):
 return self.chatbot.get_response(question)
- geoffrey.Tillman commented on June 8th 19 at 16:54
June 8th 19 at 16:41
and how to disable the serialization of data ? I am a novice in Python as I understand it, serialization is a bunch of resets of variables in one variable???

Find more questions by tags Python