Setting up Python Scripting

There are some prerequisites that you must perform before developing your Python scripts.

Prerequisites

This section assumes that you have an understanding of the Python language, and common development practices associated with it.

Procedure

  1. Install Python.
    You can verify the installation by typing python at the command prompt on a Windows machine and python3 in 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.
  2. 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
  3. Enable the Python module for TIBCO Enterprise Administrator by setting the PYTHONPATH environment variable to <TIBCO_HOME>\tea\<version>\python.
  4. 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
  5. To enable POJO support, you must enable the enable_class_generation property on EnterpriseAdministrator as follows:
    import tibco.tea 
    tea =tibco.tea.EnterpriseAdministrator(config={'enable_class_generation':True})
    The property is by default set to false, so ensure that you set this to true if you want the Python scripts to support POJO objects. POJO support comes with some supported scenarios and limitations.
  6. Ensure that the TIBCO Enterprise Administrator server is running.
Related concepts