You have list with one string item in it. Obvious way would be splitting this item at comma and unpack:
>>> line = ['192.168.1.240,fe80::350e:d28d:14a5:5cbb'] >>> ip_addr, mac_addr = line[0].split(',') >>> ip_addr '192.168.1.240' >>> mac_addr 'fe80::350e:d28d:14a5:5cbb'If the result should be dictionary then one could do this:
>>> data = dict(zip(('ip_addr', 'mac_addr'), line[0].split(','))) >>> data {'ip_addr': '192.168.1.240', 'mac_addr': 'fe80::350e:d28d:14a5:5cbb'} >>> data['ip_addr'] '192.168.1.240'
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.