Write list and value in same row csv
<p>I have several values and severals list with differents length. 
I'd like to write them in the same CSV row. </p>

<p>i.e. 
I have these values </p>

<pre><code>a=1234

b=["John","Bryan","Johnny"]

c="Value"

d=["Comedy","Action"] 
</code></pre>

<p>As output I'd like a csv file like this : </p>

<pre><code>[1234;"John";"Bryan";"Johnny";Value;Comedy;Action]
</code></pre>

<p>So far I coded this </p>

<pre><code>resultFile = open("DNA_Movie.csv",'wb')
wr = csv.writer(resultFile, dialect='excel')
wr.writerows([imdb_id, genre, actors])
</code></pre>

<p>But the result is like this: </p>

<pre><code>1234
"John","Bryan","Johnny"
"Value"
"Comedy","Action"
</code></pre>

<p>As TigerhawkT3 said you'll want to use <code>writerow</code> and also when you're instantiating your csv.writer set the <code>delimiter</code> to ';'.</p>

python csv