title: Trouble with combining CSV files
body: <p>I am combining CSV files for a project and am having trouble getting my second script to work. I used the following code to combine the first set of files, which worked fine:</p>
  
  <pre><code>import os
  import glob
  os.chdir(r"C:\Users\maria\Desktop\Project\TRI\Alabama TRI")
  fout=open("out.csv","a")
  for line in open("Alabama1988.csv"):
      fout.write("Alabama  "+str("1988")+"  "+line)    
  for num in range(1989,2018):
      f = open("Alabama"+str(num)+".csv")
      f.__next__() 
      for line in f:
           fout.write("Alabama  "+str(num)+str("  ")+line)
      f.close()
  fout.close()
  </code></pre>
  
  <p>And this is my second, which is not working at all for some reason:</p>
  
  <pre><code>import os
  import glob
  os.chdir(r"C:\Users\maria\Desktop\Project\TRI\CombinedStates")
  fout=open("out.csv","a")
  for line in open("Alabama.csv"):
      fout.write(line)
  statelist = ["Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"]
  for state in statelist:
      f = open(str(state)+".csv")
      f.__next__()
      for line in f:
           fout.write(line)
      f.close()
  fout.close()
  </code></pre>
  
  <p>I checked to make sure all the spelling and stuff was right both in the code and in the file names, plus I made sure all the files were formatted the same way, but I still have not been able to get it to work. I am wondering if I might be making some error in the second code that is noticeable or if anyone else has any ideas. The code is not returning any error messages and seems to be running when I run it, but the out.csv file is not created. Thanks!</p>