Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
t = '''Inbox:
Project 01:
- Task 01
this is a comment
this is still a comment associate with task 01
- sub 01
- sub 02
- sub 05
- Task 02
- Task 03
- sub 03
- sub 04
Project 02:
- Task 01
- proj 2 sub 01
- Task 02
- Task 03
- Task 04'''
allTasks = t.split('\n\n')
projects = [filter(None,proj.split('\n\t')) for proj in allTasks]
for i in projects:
if len(i[1:])>0:
print i[0]
print i[1]
for s in range(2,len(i[1:])):
if i[s].startswith("\t") or not i[s].startswith("-"):
print i[s]
else:
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.