Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x python中是否有一个实用程序,我可以使用它以html格式保存excel文件,而不会丢失单元格样式。?_Python 3.x_Python 2.7 - Fatal编程技术网

Python 3.x python中是否有一个实用程序,我可以使用它以html格式保存excel文件,而不会丢失单元格样式。?

Python 3.x python中是否有一个实用程序,我可以使用它以html格式保存excel文件,而不会丢失单元格样式。?,python-3.x,python-2.7,Python 3.x,Python 2.7,如何将.xls和.xlsx文件保存为html 我试过像下面这样的熊猫- wb_path = r"C:/Users/Anoop/sample.xlsx" myfile = r"C:/Users/Anoop/sample.html" import pandas as pd df = pd.read_excel(wb_path) html = df.to_html() open(myfile, 'w').write(html) 但是生成的“sample.html”没有完整的颜色编码和源excel的样

如何将.xls和.xlsx文件保存为html

我试过像下面这样的熊猫-

wb_path = r"C:/Users/Anoop/sample.xlsx"
myfile = r"C:/Users/Anoop/sample.html"
import pandas as pd
df = pd.read_excel(wb_path)
html = df.to_html()
open(myfile, 'w').write(html)
但是生成的“sample.html”没有完整的颜色编码和源excel的样式

有没有一种方法可以使用python以.html格式保存excel数据?
我的开发环境是redhat linux。

为什么这是一个python问题?这可以通过简单的网络搜索找到任何转换器来解决@Marcel Zoll,因为我有一个现有的python脚本,它可以做其他一些事情。我需要做“另存Excel为HTML”为少数.xls和.xlsx也由相同的脚本。谢谢