 <p>A Pythonic solution might a bit like @Bogdan's, but using zip and argument unpacking</p> <pre><code>workflowname, paramname, value = zip(*[line.split(',') for line in lines]) </code></pre> <p>If you're determined to use a for construct, though, the 1st is better.</p>