Skip to content

Instantly share code, notes, and snippets.

@mwhooker
Created January 17, 2012 01:42
Show Gist options
  • Save mwhooker/1624019 to your computer and use it in GitHub Desktop.
Save mwhooker/1624019 to your computer and use it in GitHub Desktop.
def spl(l):
try:
idx = l.index("\n")
except ValueError:
return l
head = l[:idx]
tail = l[idx+1:]
return [spl(head), spl(tail)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment