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-5d7e5f8dbc8b47939[……]

Click link to continue reading...