rPython (version 0.0-6)

python.load: python.load

Description

Executes Python code.

Usage

python.load( file, get.exception = TRUE )

Arguments

file
a file containing python code to be executed
get.exception
logical value indicating whether to check or not for exceptions in Python

Value

None. If the code produces some output, it is up to the caller to go and fetch if from Python using function python.get.

Details

This function runs Python code contained in a file. Typically, this file would contain functions to be called via python.call or other functions in this package.

The get.exception option allows the user to disregard Python exceptions in cases where safe calls to avoid the overhead of checking for them.

Examples

Run this code

a <- 1:4
b <- 5:8

# this file contains the definition of function concat
python.load( system.file( "concat.py", package = "rPython" ) )
python.call( "concat", a, b)

Run the code above in your browser using DataLab