Skip to content

Instantly share code, notes, and snippets.

Revisions

  1. aspose-com-kb revised this gist Mar 4, 2022. No changes.
  2. aspose-com-kb created this gist Feb 24, 2022.
    47 changes: 47 additions & 0 deletions How to Install Python for Java to Run Aspose.Cells.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,47 @@
    1. Pull Latest Ubuntu Image
    docker pull ubuntu

    2. Run Ubuntu Image Using Docker Command
    docker run -it ubuntu

    3. Install Sudo Command
    apt update
    apt upgrade
    apt install sudo
    sudo apt update

    4. Install Java
    sudo apt install default-jre

    5. Install Python
    sudo apt update
    sudo apt upgrade
    sudo apt install -y python3

    6. Install Pip Command
    sudo apt update
    sudo apt install python3-pip


    7. Install Aspose-Cells
    pip install aspose-cells
    pip install JPype1

    8. Write Sample Program And Save It As Sample.Py And Run Program
    python3 sample.py


    SAMPLE CODE TO BE WRITTEN IN Sample.Py

    import jpype
    import asposecells
    jpype.startJVM()
    from asposecells.api import Workbook

    # Instantiate a blank XLSX workbook
    wb = Workbook()

    # Save Excel file to check the environment
    wb.save("new-workbook.xlsx")

    jpype.shutdownJVM()