How-to articles, tricks, and solutions about PYTHON-3.X
Best way to convert string to bytes in Python 3?
In Python 3, you can convert a string to bytes using the bytes function.
error UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
Here is an example of how to handle a UnicodeDecodeError caused by an invalid start byte:
How can I flush the output of the print function?
To flush the output of the print function, you can use the flush parameter of the print function.