Convert list of byte strings to bytearray (byte stream)

后端 未结 3 1707
Happy的楠姐
Happy的楠姐 2021-01-07 04:58

I have a list of hex strings representing bytes, of the form \"FF\". I want to convert the whole list to a byte stream so I can send it over a socket (Python 3). It looks

3条回答
  •  执笔经年
    2021-01-07 06:03

    Refer to :

    char* PyByteArray_AsString(PyObject *bytearray) Return the contents of bytearray as a char array after checking for a NULL pointer

    from the python doc reference

提交回复
热议问题