You can use MetaFFI to do that.
As I don't know the types of "start" and "goal", I'll just refer to using numpy directly from Java, but you can also use MetaFFI to load your own function.
Let's say I want to load an array and calculate its mean, just to make a simple example.
// load python3.11 runtime
MetaFFIRuntime runtime = new MetaFFIRuntime("python311");
runtime.loadRuntimePlugin();
// load numpy package (assume it has been installed by PIP)
MetaFFIModule np = runtime.loadModule("numpy");
// load array constructor
Caller constructor = np.load("callable=array",
// parameters
new MetaFFITypeInfo[]{new MetaFFITypeInfo(MetaFFITypes.MetaFFIInt64Array, 1)},
// return values
new MetaFFITypeInfo[]{new MetaFFITypeInfo(MetaFFITypes.MetaFFIHandle)});
// load mean method
Caller pmean = np.load("callable=ndarray.mean,instance_required",
new MetaFFITypeInfo[]{new MetaFFITypeInfo(MetaFFITypes.MetaFFIHandle)},
new MetaFFITypeInfo[]{new MetaFFITypeInfo(MetaFFITypes.MetaFFIFloat64)});
// create our numpy array
var input = new long[]{1,2,3,4};
MetaFFIHandle numpyarr = (MetaFFIHandle)constructor.call((Object)input)[0];
// call mean method
double meanres = (double)(pmean.call(numpyarr)[0]);
/*
You can also get a string representation of the array by loading __str__():
// load __str__ just so we can print nicely the results
Caller pstr = np.load("callable=ndarray.mean.__str__,instance_required",
new MetaFFITypeInfo[]{new MetaFFITypeInfo(MetaFFITypes.MetaFFIHandle)},
new MetaFFITypeInfo[]{new MetaFFITypeInfo(MetaFFITypes.MetaFFIString8)});
*/
Disclaimer: I am the author of MetaFFI
Tkinteris not that bad for UI, have you really taken a look? It's definitely not worse than Swing :) Anyway, I'd agree with @Vallentin.