Qu

xlsx.sheets

Builtin index · File I/O

result = xlsx.sheets(path)

Input: path · Output: result

What it is

Names a workbook's worksheets without reading any of them, so a program can find out what it is holding before deciding what to load. path (string) is the .xlsx file.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = xlsx.sheets(path)
path stringnot documented yet
result List or Str
Returns a List of Str, the worksheet names in workbook order.

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

import xlsx
names = sheets("book.xlsx")        # opened by the import

names = xlsx.sheets("book.xlsx")   # qualified, always available

not run by the build — this one needs something the repository cannot supply · from file-io

import xlsx

t = table(city = ("Aachen", "Bonn", "Cologne"), pop = (249, 331, 1087))
xlsx.write("cities.xlsx", t, sheet = "Cities")

print(xlsx.sheets("cities.xlsx"))          # ("Cities")

print(xlsx.read("cities.xlsx"))            # a Table, city/pop

print(xlsx.read("cities.xlsx", headers = false))
output
("Cities")
city      pop
-------  ----
Aachen    249
Bonn      331
Cologne  1087
A        B   
-------  ----
city     pop 
Aachen   249 
Bonn     331 
Cologne  1087

from file-io