I changed the code that I gave as a question and got what I really needed,
def getSheetName(file_name):
pointSheetObj = []
import xlrd as xl
TeamPointWorkbook = xl.open_workbook(file_name)
pointSheets = TeamPointWorkbook.sheet_names()
for i in pointSheets:
pointSheetObj.append(tuple((TeamPointWorkbook.sheet_by_name(i),i)))
therefore, if list ( tuple) is pointSheetObjiterated, we have the name of the sheet index 1 tupleinside pointSheetObj.
Having done this, I have a name and worksheet with which I can continue to use other methods related to sheets.
source
share