TypeError: to_bytes() missing required argument ‘byteorder‘ (pos 2)
生活随笔
收集整理的這篇文章主要介紹了
TypeError: to_bytes() missing required argument ‘byteorder‘ (pos 2)
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
這個(gè)錯(cuò)誤是使用?to_bytes() 忘記添加了指定大端或者小端的類型了
下面的就會(huì)報(bào)錯(cuò)
a = 1000
print(a.to_bytes(2))
具體做法如下
a = 1000
print(a.to_bytes(2,byteorder="big"))
打印結(jié)果如下
總結(jié)
以上是生活随笔為你收集整理的TypeError: to_bytes() missing required argument ‘byteorder‘ (pos 2)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: python 字典 的pop 方法
- 下一篇: struct.error: ushort