Popular recipes tagged "splitting"http://code.activestate.com/recipes/tags/splitting/popular/2016-03-14T22:35:05-07:00ActiveState Code RecipesUnix-like split command in Python (simple version) (Python) 2016-03-14T22:35:05-07:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580620-unix-like-split-command-in-python-simple-version/ <p style="color: grey"> Python recipe 580620 by <a href="/recipes/users/4173351/">Vasudev Ram</a> (<a href="/recipes/tags/commandline/">commandline</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/shell/">shell</a>, <a href="/recipes/tags/split/">split</a>, <a href="/recipes/tags/splitting/">splitting</a>, <a href="/recipes/tags/unix/">unix</a>, <a href="/recipes/tags/utilities/">utilities</a>, <a href="/recipes/tags/utility/">utility</a>, <a href="/recipes/tags/windows/">windows</a>). </p> <p>This recipe shows how to create a simple version of the Unix split command in Python. The split command splits an input file into multiple smaller files, the size of each of which is specified by a command-line argument giving the number of lines per file. This is useful for multiple purposes, such as editing large files in pieces, backing up files to small capacity storage devices, sending files across the network, etc.</p> Split file in place into two parts (Python) 2015-02-11T20:08:35-08:00shavy89http://code.activestate.com/recipes/users/4191634/http://code.activestate.com/recipes/579025-split-file-in-place-into-two-parts/ <p style="color: grey"> Python recipe 579025 by <a href="/recipes/users/4191634/">shavy89</a> (<a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/splitting/">splitting</a>). Revision 2. </p> <p>Split file in place into two parts </p> Split a sequence or generator using a predicate (Python) 2013-01-21T16:20:17-08:00Paul McGuirehttp://code.activestate.com/recipes/users/1377254/http://code.activestate.com/recipes/578416-split-a-sequence-or-generator-using-a-predicate/ <p style="color: grey"> Python recipe 578416 by <a href="/recipes/users/1377254/">Paul McGuire</a> (<a href="/recipes/tags/partition/">partition</a>, <a href="/recipes/tags/sequence/">sequence</a>, <a href="/recipes/tags/splitting/">splitting</a>). Revision 3. </p> <p>Split a sequence or generator into two iterators, each iterating over the elements that either pass or fail a predicate function.</p>