jython.exec: jython.exec

Description Usage Arguments Details Value References Examples

View source: R/jython.exec.R

Description

Executes python code via the Jython interpreter

Usage

1
  jython.exec( rJython, python.code )

Arguments

rJython

rJython interpreter as instantiated by function rJython

python.code

a character vector containing python code, typically containing a single line with indentation and EOL characters as required by Python syntax

Details

This function runs Python code. It needs to be provided by the caller in a character vector.

The vector may consists of a single string with EOL and indentation characters embedded.

Alternatively, it can be a character vector, each entry containing one or more lines of python code.

Value

None. If the code produces some output, it is up to the caller to go and fetch if from Jython.

References

http://code.google.com/p/simplejson

Examples

1
2
3
4
5
6
rJython <- rJython()

a <- 1:4
b <- 5:8
jython.exec( rJython, c( "def concat(a,b):", "\treturn a+b" ) )
jython.call( rJython, "concat", a, b)

rJython documentation built on May 2, 2019, 4:55 p.m.

Related to jython.exec in rJython...