Last active
December 10, 2015 18:49
-
-
Save rahul8590/4477268 to your computer and use it in GitHub Desktop.
This file contains 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
f = open('data.txt' ,'r') | |
import re | |
d = {} | |
title = "" | |
for i in f: | |
j = i.split("\n") | |
if j[0] != '#' and j[0] != '': | |
if re.match('#',j[0]): | |
title = j[0] | |
title_info = [] | |
else: | |
title_info.append(j[0]) | |
d[title] = title_info |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment