.PythonPath {RSPython}R Documentation

Create Python Load Path

Description

This function handles creating a suitable value for the PYTHONPATH environment variable which controls how the Python interpreter finds its modules.

Usage

.PythonPath(path=NULL, merge=T)

Arguments

path if specified, this should be a string specifying the directories in which to find Python modules. The directory names should be separated by the appropriate directory separator (":" on Unix). If this is missing, the current value fo the PYTHONPATH environment variable is used.
merge a logical value indicating whether the basic elements needed to locate the Python modules used to implement this package should be appended to the value of the system variable PYTHONPATH

Details

The following is the algorithm used to determine the path. If there is no PYTHONPATH set, then we set our version so that one can find the RS modules.

If there is a PYTHONPATH already set, then we take it and append our value to it. This can be inhibited by specifying `merge = F'

Finally, if there is a non-null value for the path argument, then we use that as the value for PYTHONPATH. Again, if merge = T, we append the RS directories to it.

If merge is T, then we take whatever value for path is given and append it to the current value of PYTHONPATH

Value

A string (i.e. character vector of length 1) giving the appropriate setting for the PYTHONPATH environment variable.

Author(s)

Duncan Temple Lang

References

http://www.omegahat.org/RSPython, http://www.python.org

See Also

.PythonInit

Examples

 .PythonPath(system.file("tests", pkg="RSPython"))

 .PythonPath(c(.PythonPath(), system.file("tests", pkg="RSPython")))

## Not run: 
 .PythonInit(system.file("tests", pkg="RSPython"))
## End(Not run)

[Package RSPython Index]