Skip to content

Instantly share code, notes, and snippets.

@rahul8590
Last active Dec 10, 2015
Embed
What would you like to do?
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