pyGet0: Creates an R representation of an Python object

View source: R/PyGet.R

pyGet0R Documentation

Creates an R representation of an Python object

Description

The function pyGet0 gets Python objects by name.

Usage

pyGet0(key)

Arguments

key

a string specifying the name of a Python object.

Details

Primitive data types like bool, int, long, float, str, bytes and unicode are returned as R objects. Python tuples, lists, dictionaries and other Python objects are returned as virtual Python objects.

Value

Returns the specified Python object converted into an R object if possible, else a virtual Python object.

Note

pyGet0 never creates a new Python object.

Examples


if ( pyIsConnected() ){
pyExec("import os")
os <- pyGet0("os")
os$getcwd()
os$sep
os$sep <- "Hello Python!"
pyExecp("os.sep")
}

Sage-Bionetworks/PythonEmbedInR documentation built on April 17, 2023, 4:23 p.m.