Take the 2-minute tour ×

I am trying to get a list of files for a certain path in a csv file. I get the desired results but they are in a single row. How can the output appear in different rows.
My code is follows:

import csv  
import os  
path = raw_input("Enter Path:")  
w = csv.writer(csvOut)  
share|improve this question

1 Answer 1

up vote 2 down vote accepted

Call writerow multiple times to put the list into different rows.

for directory in dirList:

(But in this case I don't see the need of using CSV...)

share|improve this answer
Thanks for your help. –  Brtian Feb 8 '11 at 3:27

Your Answer


