{k: v for line in txt for k, v in [line.split('=')]}
Advantage over superb rain
's answer is ability to modify k
and v
if needed. Slight memory & speed advantage by avoiding allocation via a generator (credit @GZ0):
{k: v for k, v in (line.split('=') for line in txt)}