Complete basic configuration tasks for a Python application to make a connection and execute commands.
Python searches for an imported module in the list of directories given by the Python variable sys.path. This variable is initialized from the directory containing the application, and in the list of directories specified by the environment variable PYTHONPATH, which uses the same syntax as the shell variable PATH, that is, a list of directory names. If you have not set PYTHONPATH, or if the file is not found, the search continues in an installation-dependent default path.
To use the Adaptive Server Enterprise extension module for Python in an application, you must set either PYTHONPATH, or the Python variable sys.path to one of the following directory paths (these are the default directories where the different versions of the Adaptive Server Python extension module are installed):
Platform |
Default Installation Path |
Python Version |
---|---|---|
Windows |
$SYBASE\$SYBASE_OCS\python\python26_64\dll |
2.6 |
$SYBASE\$SYBASE_OCS\python\python27_64\dll |
2.7 |
|
$SYBASE\$SYBASE_OCS\python\python31_64\dll |
3.1 |
|
All other platforms |
$SYBASE/$SYBASE_OCS/python/python26_64r/lib |
2.6, 2.7 |
$SYBASE/$SYBASE_OCS/python/python31_64r/lib |
3.1 |
The target server’s address is obtained from the directory service or from the platform-dependent interfaces file. Create a server entry in the interfaces file or the LDAP directory service. See the Open Client and Open Server Configuration Guide for your platform.
To change the directory driver or security driver, configure libtcl.cfg
See the Open Client and Open Server Configuration Guide for your platform.
Use the runtime configuration file ocs.cfg to set:
See Using the Open Client and Open Server Runtime Configuration File in the Open Client Client-Library/C Reference Manual for information about the file syntax and the properties that can be set in the file.