title: Merging multiple CSV files without headers being repeated (using Python)
body: <p>I am a beginner with Python. I have multiple CSV files (more than 10), and all of them have same number of columns. I would like to merge all of them into a single CSV file, where I will not have headers repeated.</p>
  
  <p>So essentially I need to have just the first row with all the headers and from then I need all the rows from all CSV files merged. How do I do this?</p>
  
  <p>Here's what I tried so far.</p>
  
  <pre><code>import glob
  import csv
  
  
  
  with open('output.csv','wb') as fout:
      wout = csv.writer(fout,delimiter=',') 
      interesting_files = glob.glob("*.csv") 
      for filename in interesting_files: 
          print 'Processing',filename 
      # Open and process file
          h = True
          with open(filename,'rb') as fin:
                  fin.next()#skip header
          for line in csv.reader(fin,delimiter=','):
                  wout.writerow(line)
  </code></pre>