这是由我个人翻译的 openpyxl 的中文文档,欢迎大家挑错以及贡献
文档托管在 https://openpyxl-chinese-docs.readthedocs.io/zh_CN/latest/
这是 openpyxl 的中文文档,欢迎大家进行贡献
Home Page: https://openpyxl-chinese-docs.readthedocs.io/zh_CN/latest/
这是由我个人翻译的 openpyxl 的中文文档,欢迎大家挑错以及贡献
文档托管在 https://openpyxl-chinese-docs.readthedocs.io/zh_CN/latest/
您好,做了很多research都没有解决这个问题,所来这里求助一下,我从a文件中读取了worksheet对象
sheet_2_workbook = openpyxl.load_workbook(sheet_2_path)
sheet_2 = sheet_2_workbook.worksheets[0]
如题,我想将其添加到现有xlsx文档的新sheet/工作簿中,具体应该怎么操作呢?
我之前有尝试这么做,但是这个方法得到的新文档会丢失原有的一些格式,包括单元格底色和合并单元格
old_wb = openpyxl.load_workbook(file_list[i])
old_sheet_name = old_wb.get_sheet_names()[0]
old_ws = old_wb[old_sheet_name]
ws2 = combined_wb.create_sheet(sheet_name)
for row in old_ws.values:
ws2.append(row)
我很肯定a文件中读取的worksheet对象是包含这些格式的,因为我用下面代码转存的xlsx文档具备上述提到的格式
sheet_2_workbook.save(filename = temp_save_path)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.