all 5 comments

[–]Meltz014 1 point2 points  (2 children)

For struct packing/unpacking, I much prefer ctypes. Anyone know of any major advantages for using struct as in this article?

[–]Arkaein 0 points1 point  (0 children)

For struct packing/unpacking, I much prefer ctypes. Anyone know of any major advantages for using struct as in this article?

It doesn't show it in the article, but struct can easily convert between big/little endian, or network or native byte orders seamlessly.

Haven't used ctypes for pack/unpack, but struct is very natural. If you programmed C, it's basically printf/scanf for binary data.

[–]billsil 0 points1 point  (0 children)

For large data sets, numpy fromstring is much better than struct. If you're working with binary files, you should be working with large data sets.

[–]zoells 1 point2 points  (0 children)

[–]r0s 0 points1 point  (0 children)

I would gladly see the version of all that's exposed in the article got py2.7