import glob

fout=open("out.csv","a")
# first file:
fout.write("clip,seizure,early\n")

files_list = glob.glob('*.csv')

for file_item in files_list:
    f = open(file_item)
    f.next() # skip the header
    for line in f:
         fout.write(line)
    f.close() 
fout.close()

@@ -10,27 +10,55 @@
 ob%0A%0A
-f
 out
-=open(%22out.csv%22
+put_fname = %22out.csv%22%0Afout=open(output_fname
 ,%22a%22
@@ -140,16 +140,77 @@
 '*.csv')
+%0Afiles_list2 = %5Bi for i in files_list if not i==output_fname%5D
 %0A%0Afor fi
@@ -230,16 +230,17 @@
 les_list
+2
 :%0A    f 

Update merge_csv.py