Popular recipes by __nero http://code.activestate.com/recipes/users/4177968/2011-12-24T19:44:13-08:00ActiveState Code RecipesOrdered CSV read / write with colum based lookup (Python) 2011-12-24T19:44:13-08:00__nerohttp://code.activestate.com/recipes/users/4177968/http://code.activestate.com/recipes/577996-ordered-csv-read-write-with-colum-based-lookup/ <p style="color: grey"> Python recipe 577996 by <a href="/recipes/users/4177968/">__nero</a> (<a href="/recipes/tags/csv/">csv</a>, <a href="/recipes/tags/lookup/">lookup</a>). </p> <p>This allows you to hold on to your csv in a dict form, do lookups and modifications, and also write it in a preserved order. You can also change which column you want to be your lookup column (making sure that there is a unique id for every row of that column. In my example of usage, it assumes that both classes are contained withing the same file named 'CustomDictReader.py'</p> Python Easily Packetize / Slice / Chunk Text (Python) 2011-09-30T05:34:57-07:00__nerohttp://code.activestate.com/recipes/users/4177968/http://code.activestate.com/recipes/577885-python-easily-packetize-slice-chunk-text/ <p style="color: grey"> Python recipe 577885 by <a href="/recipes/users/4177968/">__nero</a> (<a href="/recipes/tags/chunk/">chunk</a>, <a href="/recipes/tags/packetize/">packetize</a>, <a href="/recipes/tags/regex/">regex</a>, <a href="/recipes/tags/split/">split</a>, <a href="/recipes/tags/udp/">udp</a>). </p> <p>I needed to chunk up some text to send over UDP and didn't want to have messy for loops with an if condition for size and then the little bit left over. All that struck me as very messy. I then thought of the re module and came up with a very simple solution to chunk up data.</p> Dynamically Generated Python State Machine (Python) 2011-09-30T05:16:56-07:00__nerohttp://code.activestate.com/recipes/users/4177968/http://code.activestate.com/recipes/577693-dynamically-generated-python-state-machine/ <p style="color: grey"> Python recipe 577693 by <a href="/recipes/users/4177968/">__nero</a> (<a href="/recipes/tags/dynamically/">dynamically</a>, <a href="/recipes/tags/finite/">finite</a>, <a href="/recipes/tags/generated/">generated</a>, <a href="/recipes/tags/machine/">machine</a>, <a href="/recipes/tags/state/">state</a>). Revision 6. </p> <p>This is a state machine template. It can be used as a state machine, or a state machine tester. There is very little setup required and all the states are added based on the state docstring. I made this after a friend came to me asking how I'd implement one, complaining that he couldn't find a nice example. I hope this helps.</p>