Latest recipes tagged "chunk" Code RecipesPython Easily Packetize / Slice / Chunk Text (Python) 2011-09-30T05:34:57-07:00__nero <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>