My goal: Import via PythonKit Python 3.9.1 in my Swift Project, where I can use it to package it with the needed module "openpyxl" (for filling an excel sheet with values).
Here are the imports at the beginning of the specific python file:
# some imports
import sys
from openpyxl import load_workbook # Library for editing xlsx-files
import datetime # for current date-informations
import csv # for reading csv
As you read I need Python 3 and the most Macs haven't installed it. So I want to include it in my App. I am new to Swift and have no clue how to achieve this.
What I have done so far:
- Added the Swift Package Depency for "PythonKit" (used the Github Link and chose "master" branch)
- Browsing Google for how to include a specific Python version in swift projects (and use them to execute Python files)
- Asked Google how to add a library like "openpyxl" to PythonKit/Swift
Can you take me further? I am grateful for any tips how to get these python thing work in my Swift App. Would be wonderful to integrate the python library and make it work on every machine.