Created
August 10, 2014 05:33
-
-
Save andreyshuster/4d6519396f6273c18f98 to your computer and use it in GitHub Desktop.
split string in chunks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s = %some string% | |
size = %chunk size% | |
[s[n:n+size] for n in xrange(0, len(s), size)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment