I have recently started using the scripts package and have encountered an odd problem. When I start atom from the console and run the following code I get a message saying:
IOError: [Errno 2] No such file or directory: '2013_ERCOT_Hourly_Load_Data.xls'
The xls file is in the same directory as the python code. Spyder and a Python Notebook have no problem finding the file, so I doubt is an issue with my global path settings. What should I do? If I enter the full path to the file in the Configure Script Current Working Directory script can’t find Python.
Here is the code:
import xlrd import os import csv from zipfile import ZipFile import datetime datafile = "2013_ERCOT_Hourly_Load_Data.xls" outfile = "2013_Max_Loads.csv" def parse_file(datafile): workbook = xlrd.open_workbook(datafile) sheet = workbook.sheet_by_index(0) data = None outputlist =  for col in range(1, sheet.ncols): cv = sheet.col_values(col, start_rowx=1, end_rowx=None) header = sheet.cell_value(0,col) maxval = max(cv) maxpos = cv.index(maxval) + 1 maxtime = sheet.cell_value(maxpos, 0) realtime = xlrd.xldate_as_tuple(maxtime, 0) year = realtime month = realtime day = realtime hour = realtime data = [ 'Region:', header, 'Year:', year, 'Month:', month, 'Day:', day, 'Hour:', hour, maxpos, maxtime, realtime, maxval, ] outputlist.append(data) print outputlist return outputlist parse_file(datafile)