bBox_PythonCompile( mode; script )

Parameters:
   mode:
      0 = convert both input and output line endings
      1 = skip conversion of carriage returns (the FileMaker end-of-line marker) to new lines
      8 = keep any previous globals
      9 = skip conversion, keep previous globals
   script: text to be compiled and executed later

Result:
   session reference

Error:
   bBox_LastError ($reference)

Script Step:
   none

––––––––––

First appeared in: 0.50

Examples in demo file: 30

Compatibility:   Client, macOS, Server, Ubuntu, WebDirect, WPE

––––––––––

Initializes the Python environment and compiles the script into byte code.

Once compiled, execute the script using one or more calls to bBox_PythonExecute.

When no longer needed, purge environment by calling bBox_PythonFinalize.

If there is a previously created Python environment that has not been Finalized, it will still be released, but an error may be set. Set the mode 8 flag to keep the previous environment.

When running PSOS or as a script schedule, always check if another PSOS session is still running & interacting with Python. This is because the FileMaker script engine can only have one copy of the Python environment at a time. You can also use the bBox_Python3Run, which is able to spawn multiple (and separate) Python instances.

Be sure to check the current installation requirements before attempting to use.

In addition to what's in the bBox Plug-in Demo file, see the bzPython module at https://beezwax.net/bzmodules/bzpython-fm for addtional examples of FileMaker-Python integration.