Einstieg
Contents
[
Hide
]
System Anforderungen
Aspose.Cells for Python via .NET ist plattformunabhängig API und kann auf jeder Plattform (Windows und Linux) eingesetzt werdenPython ist installiert.
Python-Version
- Python 3,6 oder höher
Installation
Windows:
Sie können ganz einfach unter Aspose.Cells for Python via .NET auspypi mit folgendem Befehl.
$ pip install aspose-cells-python
Linux:
Sie können ganz einfach unter Aspose.Cells for Python via .NET auspypi mit folgendem Befehl.
$ pip install aspose-cells-python
Mac OS:
Sie können ganz einfach unter Aspose.Cells for Python via .NET auspypi mit folgendem Befehl.
$ pip install aspose-cells-python
- Hinweis: Wenn Ihr Python Python 3.7 ist (nehmen Sie hier beispielsweise Python 3.7), können nach der Installation von aspose-cells-python die folgenden Fehler auftreten
‘/usr/local/lib/libpython3.7m.dylib’ (keine solche Datei), ‘/usr/lib/libpython3.7m.dylib’ (keine solche Datei) Eingabeaufforderung.
Fügen Sie in einer solchen Situation bitte den folgenden Befehl zu Ihrem bash_profile hinzu (finden Sie zuerst, wo libpython3.7m.dylib ist, nehmen Sie /Library/Frameworks/Python.framework/Versions/3.7/lib
zum Beispiel hier)
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/Library/Frameworks/Python.framework/Versions/3.7/lib" export LIBRARY_PATH="$LIBRARY_PATH:/Library/Frameworks/Python.framework/Versions/3.7/lib/"
Erstellen der Hello World-Anwendung
- Erstellen Sie eine Datei mit dem NamenErstellen von HelloWorldFile.py und verwenden Sie den folgenden Beispielcode:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aspose.cells | |
from aspose.cells import Workbook | |
# Create an instance of the Workbook class. | |
workbook = Workbook() | |
# Insert the words Hello World! into a cell accessed. | |
workbook.worksheets.get(0).cells.get("A1").put_value("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") |
- Speichern Sie nun den obigen Code in „CreatingHelloWorldFile.py“ und führen Sie „python CreatingHelloWorldFile.py“ @command prompt aus.