pyGet0: Creates an R representation of an Python object

Description Usage Arguments Details Value Note Examples

View source: R/PyGet.R

Description

The function pyGet0 gets Python objects by name.

Usage

1
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

1
2
3
4
5
6
7
8
if ( pyIsConnected() ){
pyExec("import os")
os <- pyGet0("os")
os$getcwd()
os$sep
os$sep <- "Hello Python!"
pyExecp("os.sep")
}

PythonInR documentation built on July 1, 2020, 6:05 p.m.