Sep-24-2019, 08:22 PM
thank you for the link. I have reviewed and am unable to find the details i am looking for. I am following an exercise in a book called Automate the boring stuff. i am following the exercise exactly and typing the following code
the output the book is saying i should get is
>>> import openpyxl >>> wb=openpyxl.load_workbook('Example_Page267.xlsx') >>> sheet=wb.active >>> sheet.columns[1]
the output the book is saying i should get is
(<cell Sheet1.B1>,<cell Sheet1.B2>,<cell Sheet1.B3>,<cell Sheet1.B4>,<cell Sheet1.B5>,<cell Sheet1.B4>,<cell Sheet1.B5>,<cell Sheet1.B6>,<cell Sheet1.B7>)but instead i am getting the error message
Traceback (most recent call last): File "<pyshell#160>", line 1, in <module> sheet.columns[1] TypeError: 'generator' object is not subscriptablecould you give me an example of the code i should be inputting to get that output?