Python strings and arrays of bytes

When using Python to do network programming will inevitably encounter convert a string to the byte stream,Here we record the following commonly used methods:

First byte array to a string,That is str:

Then the string to a byte array:
[crayon-5d09a19431f4e3482[……]

Click link to continue reading...