Load Workbook
load_workbook()
is a method provided by the openpyxl
library in Python that allows you to load an existing Excel workbook from a file into memory. The load_workbook()
method takes a filename as a parameter and returns a workbook object that represents the file's contents.
Taak
Swipe to start coding
- Load a workbook called
"sample_data.xlsx"
; - Print the
sheetnames
; - Print the active sheet.
Oplossing
9
1
2
3
4
5
6
from openpyxl import load_workbook
workbook = load_workbook(filename="sample_data.xlsx")
print(workbook.sheetnames)
print(workbook.active)
Mark tasks as Completed
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 1. Hoofdstuk 4
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.