Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
你好!
我正在使用 xlwt 包用 python 创建 excel 文件。我想知道,有没有办法使用这个模块为每张纸设置特定的页眉/页脚?
非常感谢!
sheet = book.get_sheet(0) sheet.header_str = 'what you prefer' sheet.footer_str = 'things'
您可以使用简单的 for 语句对书中的所有工作表执行此操作。
for s in book.sheets(): s.header_str = 'what you prefer'