# -*- coding: utf-8 -*- import sys import xlrd import json file = sys.argv[1] #print(file) data = xlrd.open_workbook(file) table=data.sheets()[0] nrows=table.nrows #print(nrows) ncols = table.ncols #print(ncols) returnData={} for i in range(nrows ): returnData[i]=table.row_values(i) returnJson=json.dumps(returnData) print(returnJson)