Python : UnicodeEncodeError: 'latin-1' codec can't encode character

后端 未结 3 1298
别跟我提以往
别跟我提以往 2021-01-04 05:34

I am at a scenario where I call api and based on the results from api I call database for each record that I in api. My api call return strings and when I make the database

3条回答
  •  没有蜡笔的小新
    2021-01-04 06:14

    u.encode('utf-8') converts it to bytes which can then be printed on stdout using sys.stdout.buffer.write(bytes) checkout the displayhook on https://docs.python.org/3/library/sys.html

提交回复
热议问题