title: Unable to open excel file created inthe python code
body: <p>I converted a few .csv files using python code to .xls but now when i try to open the files it gives me an error : "COUNT_DIST2.xls cannot be accessed. The file may be corrupt, located on a server that is not responding , or read only". 
  I have created many other files in this projects which are both .csv and .xls but none of them are giving me this problem. I think in my code somewhere maybe i am doing something wrong. I am very sure this is not a network error or office error because i am able to open all the other documents. </p>
  
  <p>Attached is the code: </p>
  
  <pre><code>import pandas as pd
  import numpy as np
  from xlrd import open_workbook
  from xlwt import Workbook
  from xlutils.copy import copy
  from openpyxl import load_workbook
  import matplotlib.pyplot as plt
  import xlwt
  import os
  path = ('C:\Users\PETERemote\PycharmProjects\untitled\distributions')
  data = []
  count =1
  count2 = 0
  for files in os.listdir(path):
      if files.endswith("COUNT16_DISTRIBUTION" + str(count*1) + ".csv"):
          count += 1
  count2 = count-2
  print(count2)
  #print(count2 = count)
  
  count3=1
  file_name = "COUNT16_DISTRIBUTION" + str(count3*1) + ".csv"
  while (count3&lt;=count2):
      with open(file_name) as f:
          for line in f:
              data.append([word for word in line.split("  ") if word])
      wb = xlwt.Workbook()
      output_file = open("COUNT16_DIST" + str(count3 * 1) + ".xls", 'w')
      count3 += 1
      sheet = wb.add_sheet("Sheet1")
      for row_index in range(len(data)):
          for col_index in range(len(data[row_index])):
              sheet.write(row_index, col_index, data[row_index][col_index])
      wb.save(output_file)
      data = []
      output_file.close()
  </code></pre>