Most viewed recipes tagged "py3"http://code.activestate.com/recipes/tags/py3/views/2009-02-25T07:39:52-08:00ActiveState Code RecipesNicer struct syntax thanks to Py3 metaclasses (Python)
2009-02-25T07:39:52-08:00Daniel Brodiehttp://code.activestate.com/recipes/users/1892511/http://code.activestate.com/recipes/576666-nicer-struct-syntax-thanks-to-py3-metaclasses/
<p style="color: grey">
Python
recipe 576666
by <a href="/recipes/users/1892511/">Daniel Brodie</a>
(<a href="/recipes/tags/binary/">binary</a>, <a href="/recipes/tags/parsing/">parsing</a>, <a href="/recipes/tags/py3/">py3</a>, <a href="/recipes/tags/struct/">struct</a>).
</p>
<p>This is a quick-hack module I wrote up in a couple of hours that allows for a nicer syntax to build up struct-like binary packing and unpacking. The point was to get it to be concise and as C-like as possible. This script requires python3 for it's improved metaclass support.</p>