Writing list of tuples as a CSV file
<p>I got a problem with writing a csv file in way that i want.</p>

<p>Description:</p>

<p>I got 3 lists:</p>

<pre><code>list1=[1,2,3]

list2=['dd1','dd2','dd3']

list3=['vi1','vi2','vi3']
</code></pre>

<p>I want to write my csv file like:</p>

<pre><code>      Column 1| Column 2| Column 3
Row 1        1|      dd1|      vi1
Row 2        2|      dd2|      vi2
Row 3        3|      dd3|      vi3
</code></pre>

<p>So i use <code>zip</code> method like this:</p>

<pre><code>csvd = zip(list1, list2, list3)
</code></pre>

<p>After zipping i have:</p>

<pre><code>csvd = [(1, 'dd1', 'vi1'), (2, 'dd2', 'vi2'), (3, 'dd3', 'vi3')]
</code></pre>

<p>And next i use csv writer like this:</p>

<pre><code>with open('path\\test.csv', 'w') as f:
     writer = csv.writer(f, delimiter='\t')
     writer.writerows(csvd)
</code></pre>

<p>This is my output:
<a href="http://i.stack.imgur.com/y5FP3.png" rel="nofollow">csv</a></p>

<p>First thing is that, there is every touple in first column (i want each element of touple to be in different column).
Second problem is that i got an empty lines between nexts touples.</p>

<p>I tried to solve my problem with just <code>writerow</code> and <code>for loop</code> but this is only solution for my second problem, with this method i still got every touple in first column.</p>