Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if __name__=="__main__":
- result = {}
- for line in open('data.ini'):
- result.update( dict([(a.strip(), b.strip()) for a,b in [y.split('=',1) for y in [x.strip() for x in line.split(',') if x.strip()] if '=' in y ]]) )
- result.update( dict([(a.strip(), b.strip()) for a,b in [(y,'0') for y in [x.strip() for x in line.split(',') if x.strip()] if '=' not in y ]]) )
- print result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement