I have a tiny little helper app in Python - 10 lines of code calling into a library. I’m doing final testing of the 64bit version of my app and see what I found:
The code lives in a compiled Python app which I call with the shell:
[code]dim PathToPython as FolderItem = App.ExecutableFile
if PathToPython <> nil and PathToPython.Exists then PathToPython = PathToPython.Parent.Parent
if PathToPython <> nil and PathToPython.Exists then PathToPython = PathToPython.Child(“Resources”)
if PathToPython <> nil and PathToPython.Exists then PathToPython = PathToPython.Child(“fix_encoding.app”)
if PathToPython <> nil and PathToPython.Exists then PathToPython = PathToPython.Child(“Contents”)
if PathToPython <> nil and PathToPython.Exists then PathToPython = PathToPython.Child(“MacOS”)
if PathToPython <> nil and PathToPython.Exists then PathToPython = PathToPython.Child(“fix_encoding”)
if PathToPython = Nil or not PathToPython.Exists then Return
dim tempFile as FolderItem = GetTemporaryFolderItem
try
dim binStream as BinaryStream = BinaryStream.Create(tempFile, True)
binStream.Write(currentBody)
binStream.Close
catch err as IOException
Return
end try
dim PythonShell as new Shell
PythonShell.Mode = 0
PythonShell.Execute(PathToPython.ShellPath + " " + tempFile.ShellPath)
if PythonShell.ErrorCode = 0 then currentBody = PythonShell.Result[/code]
i can follow that, but since the Python module is part of your app and not standalone (I’m guessing), why bloat your app when 95% of all system have a python interpreter on board. I have my python code in 64 bit encoded strings and I write them out to temp files and then call the onboard Python interpreter as above.
I’m also looking at the Python module in the Einhugur suite to just handle the code internally.