powered by
python.exec( python.code, get.exception = TRUE )
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.
get.exception
a <- 1:4 b <- 5:8 python.exec( c( "def concat(a,b):", "\treturn a+b" ) ) python.call( "concat", a, b)
Run the code above in your browser using DataLab