Latest recipes tagged "cpp"http://code.activestate.com/recipes/tags/cpp/new/2009-05-02T11:27:22-07:00ActiveState Code RecipesC struct decorator (Python) 2009-05-02T11:27:22-07:00geremy condrahttp://code.activestate.com/recipes/users/4170000/http://code.activestate.com/recipes/576734-c-struct-decorator/ <p style="color: grey"> Python recipe 576734 by <a href="/recipes/users/4170000/">geremy condra</a> (<a href="/recipes/tags/cpp/">cpp</a>, <a href="/recipes/tags/decorator/">decorator</a>, <a href="/recipes/tags/struct/">struct</a>). Revision 3. </p> <p>Like my earlier <a href="http://code.activestate.com/recipes/576731/">C function decorator</a>, this recipe is designed to make it easier to interact with C by removing some of the boilerplate code from defining C structs in Python.</p> C function decorator (Python) 2009-04-29T23:55:03-07:00geremy condrahttp://code.activestate.com/recipes/users/4170000/http://code.activestate.com/recipes/576731-c-function-decorator/ <p style="color: grey"> Python recipe 576731 by <a href="/recipes/users/4170000/">geremy condra</a> (<a href="/recipes/tags/cpp/">cpp</a>, <a href="/recipes/tags/ctypes/">ctypes</a>, <a href="/recipes/tags/decorator/">decorator</a>, <a href="/recipes/tags/function/">function</a>). Revision 6. </p> <p>This recipe provides an easy-to-use, decorator-based solution to the problem of using functions from other languages, especially C, in Python. It takes advantage of Python's new annotations to provide simple type checking and automatic conversion. If you like it, you may also want to check out my <a href="http://code.activestate.com/recipes/576734/">C structure decorator</a></p>