Python struct.unpack errors with TypeError: a bytes-like object is required, not 'str'

后端 未结 1 1636
执念已碎
执念已碎 2021-01-22 05:09

Can someone please help with the following line of code and Error? I am unfamiliar with python value conversions.

The specific line that generates the error is:

1条回答
  •  孤独总比滥情好
    2021-01-22 05:37

    When you are using Python 2.x str is a byte array. For Python 3, you must use bytes like this:

    struct.unpack("

    0 讨论(0)
提交回复
热议问题