Setting up Python Scripting
There are some prerequisites that you must perform before developing your Python scripts.
Before you begin
This section assumes that you have an understanding of the Python language, and common development practices associated with it.
- Procedure
- Install Python.
You can verify the installation by typing
pythonat the command prompt on a Windows machine andpython3in a shell on a UNIX machine.Caution: TIBCO Enterprise Administrator uses the pip module that is packaged with Python 3.4.1. If you are using an earlier version of Python, install the pip module. - Install the requests module needed to make the HTTP calls. At the command prompt, navigate to <PYTHON_HOME>\scripts, and install the module using the following command:pip install requests
- Enable the Python module for TIBCO Enterprise Administrator by setting the
PYTHONPATHenvironment variable to <TIBCO_HOME>\tea\<version>\python. - You must install the
jsonpickle
module if you want to use Python scripts in the TIBCO Enterprise Administrator agent for TIBCO Security Server. You must also install this module, if you want Python scripts to support plain old java objects (POJOs). In the case of POJOs,
jsonpickle module is needed to serialize and deserialize java objects. Based on the version of Python you are using, you can install the module using the following command:
Python Version Command 2 pip install jsonpickle 3 pip3 install jsonpickle - To enable POJO support, you must enable the
enable_class_generationproperty onEnterpriseAdministratoras follows:import tibco.tea tea =tibco.tea.EnterpriseAdministrator(config={'enable_class_generation':True})The property is by default set tofalse, so ensure that you set this totrueif you want the Python scripts to support POJO objects. POJO support comes with some supported scenarios and limitations. - Ensure that the TIBCO Enterprise Administrator server is running.