These functions allow application code to invoke evaluator methods for essentially all basic computations. Usually, they access the current Python evaluator, starting one if none exists. For details, see the documentation for the corresponding method, under PythonInterface.
pythonSend(object, evaluator = XR::getInterface(.PythonInterfaceClass))pythonEval(expr, ..., evaluator = XR::getInterface(.PythonInterfaceClass))
pythonCommand(expr, ..., evaluator = XR::getInterface(.PythonInterfaceClass))
pythonCall(fun, ..., evaluator = XR::getInterface(.PythonInterfaceClass))
pythonGet(object, evaluator = XR::getInterface(.PythonInterfaceClass))
pythonSource(file, ..., evaluator = XR::getInterface(.PythonInterfaceClass))
pythonDefine(text, file, ...,
evaluator = XR::getInterface(.PythonInterfaceClass))
pythonSerialize(object, file, append = FALSE,
evaluator = XR::getInterface(.PythonInterfaceClass))
pythonUnserialize(file, all = FALSE,
evaluator = XR::getInterface(.PythonInterfaceClass))
pythonName(object)
pythonShell(..., evaluator = XR::getInterface(.PythonInterfaceClass))
For pythonSend()
, an R object, to be sent to Python. For pythonGet()
,
pythonSerialize()
and pythonNqme()
, a proxy object for
a Python object.
The evaluator object to use. By default, and usually, the current evaluator is used, and one is started if none has been.
A string for a Python expression or command, with C-style fields ("%s"
) to be substituted for the following arguments, if any.
For the evaluation functions: Objects, either R objects to be converted or proxies for Python objects previously computed.
For other functions, specialized arguments for the corresponding method.
In particular, .get=
for controlling whether the computed result should be converted.
the string name of the function; a module name must be included in the string if the function has not been explicitly imported from that module.
A filename or an open connection, for reading or writing depending on the function
the definition as text (supply argument file= instead to read it from a file)
should the serializing text be appended to a file; otherwise the file will be truncated on opening.
should the unserialized object be a list of all serialized objects on the file?
pythonSend
: sends the object
to Python, converting it via methods for
asServerObject
and returns a proxy for the converted object.
pythonEval
: evaluates the expr
string subsituting the arguments.
pythonCommand
: evaluates the expr
string subsituting the arguments; used for a command that is not
an expression.
pythonCall
: call the function in Python, with arguments given.
pythonGet
: converts the proxy object that is its argument to an R object.
pythonSource
: evaluate the file of Python source.
pythonDefine
: define a Python function
pythonSerialize
: serialize the object
in Python, via pickle
pythonUnserialize
: unserialize the file in Python, via pickle
pythonName
: return the name by which this proxy object was assigned in Python
pythonShell
: Start an interactive Python shell. See the chapter file in the documentation, section 14.3.