ฉันมีรายการไบต์เป็นจำนวนเต็มซึ่งก็เหมือนกับ
[120, 3, 255, 0, 100]
ฉันจะเขียนรายการนี้ลงในไฟล์เป็นไบนารีได้อย่างไร?
จะได้ผลไหม
newFileBytes = [123, 3, 255, 0, 100]
# make file
newFile = open("filename.txt", "wb")
# write to file
newFile.write(newFileBytes)
TypeError: argument 1 must be string or buffer, not listควรจะเป็น