(PYVMS LOGO) Python on OpenVMS

(go to: table of contents, index)

This section explains how Python works in the OpenVMS environment. See also the 'programming guidelines' page.

path support

Python uses several 'environment variables' which tell the executable where the other files (so called libraries) are located.

Most of the work is done in the file GETPATH.C. On OpenVMS, a heavily modified version is stored in VMS__GETPATH.C.

The original version of GETPATH.C uses the path to the executable for further lookup. This code has been removed from VMS__GETPATH.C. Several attempts are made to find special 'landmark' files ("string.py") - this code as been removed, too.

Two directories are needed:

prefix
This directory contains the platform independent common '.py' and '.pyc' files.

A symbol or logical name "PYTHON_LIBRARY" is checked for the prefix. Python's 'sys' module will contain a string named 'prefix'. Its value will also be appended to the 'path' as shown below. Note: the file specification must be in POSIX notation as shown below. (Currently,) you cannot specify a list of file specifications (e.g.: "/spec1:/spec2").

$ define PYTHON_LIBRARY "/DKA100/PYTHON/PYTHON-1_5_1/LIB"
$ python
Python 1.5.1 (V001P2, Jun 22 1998, 20:34:34) [DECC] on vms
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
portions Copyright 1996-1998 Uwe Zessin
>>> print sys.prefix
/DKA100/PYTHON/PYTHON-1_5_1/LIB
>>>
>>> for idx in range(len(sys.path)):
...   print sys.path[idx]
...

/DKA100/PYTHON/PYTHON-1_5_1/LIB/LIB-TK
/DKA100/PYTHON/PYTHON-1_5_1/LIB         <-- appended
>>>
exec_prefix
This directory contains platform dependent files - so called shared library modules, which are similar to OpenVMS' shareable images. They are used to dynamically loaded additional modules. There is currently (27-JUL-1998) no support for this.

A symbol or logical name "PYTHON_SHARE" is checked for the exec_prefix. Python's 'sys' module will contain a string named 'exec_prefix'. Its value is currently (19-JUL-1998) NOT appended to 'sys.path'.


@@ explain PYTHONPATH ...
(go to: table of contents, index)

29-JUL-1998 ZE.