我正在运行 Python 脚本,在其中编写 excel 文件以将它们放入我的 EC2 实例中。但是,我注意到这些 excel 文件虽然已创建,但仅在代码停止后才会放入服务器中。
我猜它们保存在缓存中,但我希望它们立即添加到服务器中。代码中是否需要添加“commit()”?
非常感谢
最佳答案
I guess they are kept in cache but I would like them to be added to the server straight away. Is there a "commit()" to add to the code?
没有。无法像 CSV 或 Html 文件一样流式传输或写入部分 xlsx 文件,因为该文件格式是 Zip 容器中 XML 文件的集合,并且在文件关闭之前无法生成。
关于python - EC2 实例上的 xlsxwriter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46300696/