Conversión a archivos MHTML en Python

Aspose.Cells - Conversión a MHTML

Para convertir la hoja de trabajo al archivo MHTML usando Aspose.Cells for Java en Python, simplemente invoque la hoja de trabajo_a_Método mhtml() del módulo Converter.

Código Python

 saveFormat = self.SaveFormat

# Specify the file path

filePath = self.dataDir + "Book1.xlsx"

# Specify the HTML saving options

sv = self.HtmlSaveOptions(saveFormat.M_HTML)

# Instantiate a workbook and open the template XLSX file

wb = self.Workbook(filePath)

# Save the MHT file

wb.save(filePath + ".out.mht", sv)

\# Print message

print "Excel to MHTML conversion performed successfully."

Descargar código de ejecución

DescargarConvirtiendo a MHTML (Aspose.Cells) de cualquiera de los sitios de codificación social mencionados a continuación: