python.load: python.load

Description Usage Arguments Details Value Examples

Description

Executes Python code.

Usage

1
  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

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.

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.

Examples

1
2
3
4
5
6
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)

cjgb/rPython-win documentation built on May 13, 2019, 7:32 p.m.