Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. dic = dict()
  2. temp = list()
  3. i = 0
  4.  
  5. for line in lines:
  6.     if line.strip():
  7.         if not i:
  8.             temp = list()
  9.             key = line.strip()
  10.             i = 1
  11.             continue
  12.     if not line.strip() and i==1:
  13.         i = 2
  14.         continue
  15.     if not line.strip() and i==2:
  16.         dic[key] = temp
  17.         key = ''
  18.         i = 0
  19.         continue
  20.     if line.strip():
  21.         temp.append(line.strip())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement