Description Usage Arguments Details Value Examples
Executes Python code contained in an R character vector.
1 | python.exec( python.code, get.exception = TRUE )
|
python.code |
a character vector containing Python code, typically a single line with indentation and EOL characters as required by Python syntax |
get.exception |
logical value indicating whether to check or not for exceptions in Python |
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.
The get.exception
option allows the user to disregard Python exceptions in cases where safe calls to avoid the overhead of checking for them.
None. If the code produces some output, it is up to the caller to go and fetch if from Python.
1 2 3 4 | a <- 1:4
b <- 5:8
python.exec( c( "def concat(a,b):", "\treturn a+b" ) )
python.call( "concat", a, b)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.