dir_name = "c:\somefolder"
file_list = [f_name for f_name in os.listdir(dir_name) if os.path.isfile(f_name) and f_name.endswith('.fasta')]
combine_file_name = "combine.txt"
f_combine = open(combine_file_name,"w")
for f_in_name in file_list:
f = open(f_in_name,'r')
for line in f.readlines():
f_combine.write(line)
f.close()
f_combine.close()