.PythonEvalFile {RSPython}R Documentation

Evaluate a Python script from a string or file.

Description

These two functions allow one to evaluate Python scripts which are given in the Python syntax. These can be specified as a string or as a file containing the Python code. This approach to evaluating Python commands is less flexible than those offered by .Python and related functions.

Usage

.PythonEvalFile(cmd, ..., .module=NULL, .convert=T)
.PythonEval(cmd, ..., .module=NULL, .convert=T)

Arguments

cmd the Python expression to parse and evaluate.
... Any number of name-value pairs that are converted to a Python dictionary or context which will be used when evaluating the expression.
.module the name of the module whose dictionary is used to provide the name space for resolving symbols in the Python expressions.
.convert a logical value indicating whether the result of evaluating the Python object should be converted to a regular R object, if possible, or explicitly left within Python and returned as a PythonReference object.

Details

Value

The value returned from evaluating the Python expression(s), converted to R using the standard conversion mechanism, including any user-level converters currently registered.

Author(s)

Duncan Temple Lang

References

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

See Also

.Python .PythonMethod .PythonNew

Examples

 .PythonEval("from sys import *")
 .PythonEval("argv")

[Package Contents]