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
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