def paragraph(lines):
    for group_separator, line_iteration in groupby(lines.splitlines(True),
        key=str.isspace):
        if not group_separator:
            yield ''.join(line_iteration)
for p in paragraph("""p1
p2	
	still p2	   
	p"""):
    print(repr(p))
Регулярное выражение Python для разделения абзацев