> Thanks regards to your suggestion, but I don't understand why we have
> to put the IF statement?
It's just an example, one possible implementation could be:
def parse_data(data):
mapping = {}
for line in data.splitlines():
if not line.strip():
continue
key, value = line.split(":", 1)
mapping[key] = value
return mapping
HTH,
--
Miki <[EMAIL PROTECTED]>
http://pythonwise.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
