Using system Python interpreter for command-line probes

By default, the ${PYTHON} macro will invoke InterMapper's built-in Python interpreter when running command-line probes. This is convenient for most installations, since this interpreter is tested and known to work, has a stable set of libraries and modules, etc.

In some circumstances, a probe writer may wish to use a different Python interpreter, perhaps because of backwards compatibility with a particular library, need to use a newer version of Python, etc. This is easily accomodated in the command-line probe. Simply add the full path to the Python executable in the "cmd" line.

Example: The standard Python interpreter can be downloaded from http://www.python.org It installs the interpreter at: c:\Python27\python.exe

Use this to invoke this interpreter in the command-line probe so that it runs the script test.py:

 

Code:
<command-line>
  path = ""
  cmd = "c:\Python27\python.exe test.py"
  arg = ""
  input = ""
</command-line>


Notes

  • Using the example above, you may place the test.py script either in the InterMapper Settings/Tools folder, or within a <tool> section within the probe file itself.
  • This same technique (placing the full path to the executable) will work for invoking Python, Perl, or other executable programs.
  • InterMapper always changes the working directory to the one mentioned in the "path" variable. If it is empty, InterMapper changes to the InterMapper Settings/Tools folder.