Python-bytes() vs struct.pack() -


I'm just curious here, but when I'm using bytes () bytes I learned the dragon until it was until I saw struct.pack () . I did not bother to learn how to use it because I thought it was basically like byte . But it appears that many people like to use struct.pack () . Why? What are the advantages of one over the other?

bytes () literally means that the name means:

Return a new "byte" object, which can be found in category 0 & lt; = X & lt; There is an unchanging sequence of integers in 256

hit.pack () makes a lot different:

This module uses Python Convergence between values ​​and C strands indicates that as a python string

This can be equivalent to some input, they are not all in the same operation. struct.pack () essentially produces a byte-string that represents a POD C-struct in memory, it is useful for serializing / delivering data.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -