Run a Python Application
Once you installed the driver, you will need an IP of the cluster and a user’s credentials. You will use them in the same manner as done with other databases.
In the following example, there’s a code that performs some of the operations similar to the ones done in the Regatta Platform section.
You will need to add the reference to the regatta driver:
Note that you should import all relevant classes based on the functionality of your application and its requirements.
In the next step you will need to add the cluster IP and the user’s credentials. These can be attained by following the described in the External Access to the Regatta Database chapter.
Then all the code that performs the different SQL commands should be changed accordingly.
Below is an example of some of the code. Note that this example is also available as part of the downloaded driver.
Unlike the Platform, in the commands used by the driver we need to specify the device mapping when creating a table. In the example below we will use a single device.
Figure 46 Python example of application using driver
The following is the output of the driver (Figure 47):
Figure 47 Python example output
And so on. All commands performed in the Regatta Platform section can be performed in the same manner using a Python application.