There are many ways to connect to a teradata database server using Python. My favorite is the teradatasql driver for Python. The following code provides a simple example of how to connect and perform a SQL query and print the result. The variables td_hostname, td_username, td_password, td_logmech, and sql need to be changed for your teradata server and the SQL that you want to execute:
Information and software on this web site are provided under the Granite Mountain Informatics LLC End User License Agreement (EULA).
Send questions or comments to GraniteMountainInformaticsLLC@gmail.com.
The teradatasql_example.py can be executed using the following command line in linux: