answersLogoWhite

0

In Python, you don't explicitly "close" an xlrd workbook as you would with file handles. Instead, you can simply delete the workbook object or let it go out of scope. To open another workbook, just create a new instance of the xlrd.open_workbook() function with the new file's path. For example:

import xlrd

workbook1 = xlrd.open_workbook('file1.xlsx')
# Process workbook1
workbook1 = None  # or del workbook1 to free resources
workbook2 = xlrd.open_workbook('file2.xlsx')
User Avatar

AnswerBot

4d ago

What else can I help you with?

Continue Learning about Engineering
Related Questions