Popular recipes by Yony Kochinski http://code.activestate.com/recipes/users/4175703/2011-05-03T23:06:30-07:00ActiveState Code RecipesDecoding Binary Files (Python)
2011-03-15T00:11:10-07:00Yony Kochinskihttp://code.activestate.com/recipes/users/4175703/http://code.activestate.com/recipes/577610-decoding-binary-files/
<p style="color: grey">
Python
recipe 577610
by <a href="/recipes/users/4175703/">Yony Kochinski</a>
(<a href="/recipes/tags/binary/">binary</a>, <a href="/recipes/tags/decode/">decode</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/python/">python</a>).
Revision 2.
</p>
<p>One way to read files that contain binary fields is to use the <code>struct</code> module. However, to do this properly one must learn struct's format characters, which may look especially cryptic when sprinkled around the code. So instead, I use a wrapper object that presents a simple interface as well as type names that are more inline with many <a href="http://en.wikipedia.org/wiki/Interface_description_language">IDLs</a>.</p>
Easy XML (Python)
2011-05-03T23:06:30-07:00Yony Kochinskihttp://code.activestate.com/recipes/users/4175703/http://code.activestate.com/recipes/577451-easy-xml/
<p style="color: grey">
Python
recipe 577451
by <a href="/recipes/users/4175703/">Yony Kochinski</a>
(<a href="/recipes/tags/xml/">xml</a>).
Revision 2.
</p>
<p>Being that I only use XML on occasion for some very basic features, I find myself having to re-learn the appropriate syntax every time. After doing this for the n-th time, I finally decided to wrap this syntax in something that's much more intuitive (to me, at least). The main goal is to make this as simple an API as possible, at the cost of some features.</p>