Getting Started

System Requirements

Aspose.Cells for Python via Java is platform-independent API and can be used on any platform (Windows, Linux and MacOS) where Python is installed. The machine must have Java 8 or greater versions before setting up the installation.

Python Version

  • Python 3.5 or higher

Java Version

  • Java 1.8 or higher

Installation

Windows:

  • Install Java and set the JAVA_HOME and PATH environment variables For example:

    JAVA_HOME=C:\jdk1.8.0_131
    
    PATH=C:\jdk1.8.0_131\bin;

  • Install Aspose.Cells for Python via Java from pypi You can easily use Aspose.Cells for Python via Java from pypi with the following command.

     $ pip install aspose-cells

Linux:

  • Install Java

  • Install Aspose.Cells for Python via Java from pypi You can easily use Aspose.Cells for Python via Java from pypi with the following command.

     $ pip install aspose-cells

macOS:

  • Install Java

  • Install Aspose.Cells for Python via Java from pypi You can easily use Aspose.Cells for Python via Java from pypi with the following command.

     $ pip install aspose-cells

Creating the Hello World Application

  • Create a file named CreatingHelloWorldFile.py and use the following sample code:
import jpype
import asposecells
jpype.startJVM()
from asposecells.api import Workbook
# Create an instance of the Workbook class.
workbook = Workbook()
# Insert the words Hello World! into a cell accessed.
workbook.getWorksheets().get(0).getCells().get("A1").putValue("Hello World")
# Save as XLS file
workbook.save("output.xls")
# Save as XLSX file
workbook.save("output.xlsx")
# Save as ods file
workbook.save("output.ods")
jpype.shutdownJVM()
  • Now save the code above to “CreatingHelloWorldFile.py” and run “python CreatingHelloWorldFile.py” @command prompt.