I have a list
[\'Tests run: 1\', \' Failures: 0\', \' Errors: 0\']
I would like to convert it to a dictionary as
{\'Tests r
>>> s = ['Tests run: 1', ' Failures: 0', ' Errors: 0'] >>> {i.split(":")[0].strip():int(i.split(":")[1].strip()) for i in s} {' Failures': 0, 'Tests run': 1, ' Errors': 0}