Skip to content

Instantly share code, notes, and snippets.

@rahul8590
Last active December 10, 2015 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahul8590/4477268 to your computer and use it in GitHub Desktop.
Save rahul8590/4477268 to your computer and use it in GitHub Desktop.
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