I have a Python script that generates Word documents. I would like my users to click a button and get the Word document as a download.
It does not seem to be possible to pass the binary data the script generates using application.executeProgram as this returns Strings.
Have anyone done integrations like this? Where do I get Python to save files so they can be read by the Servoy server?
As executeProgram returns a string, would it be possible to let Python return the doc as base64?
Then it would be pretty easy:
var _aBytes = utils.base64ToBytes(_sPythonB64)
plugins.file.writeFile('myWordDocument.docx', _aBytes)
Otherwise, you should let Python write the file to a location which can be accessed by the application_server.
Then you can just read the bytes from that file and use the same writeFile command as above.