Writing multiple fields in one line (Python/CSV)
<p>i am currently writing some output from an xml file into a csv in the following way:</p>

<pre><code>with open(csv_fname, "w") as f:

    writer = csv.DictWriter(f, fields, delimiter=";", extrasaction="ignore")
    writer2 = csv.DictWriter(f, fields2, delimiter=";", extrasaction="ignore")
    for node in xml.iter("TrdCaptRpt"):
        for data in node.iter("Instrmt"):
            writer.writerow(node.attrib)
            writer2.writerow(data)
</code></pre>

<p>However I want to have writer.writerow(node.attrib) and writer2.writerow(data) in one line however it doesn't work with &amp;&amp;? </p>

<p>Are there any suggestions how I can just append both and write them into one line ?</p>

<p>thanks</p>