Python Execution

import import_main import_builtins import_from_path

Import a Python module

py_run_string py_run_file py_eval

Run Python code

Python Types

dict

Create Python dictionary

tuple

Create Python tuple

np_array

NumPy array

iterate iter_next

Traverse a Python iterator or generator

with

Evaluate an expression within a context.

Python Configuration

py_config

Python configuration

py_discover_config

Discover the version of Python to use with reticulate.

py_available py_numpy_available

Check if Python is available on this system

py_module_available

Check if a Python module is available on this system.

use_python use_virtualenv use_condaenv

Configure which version of Python to use

Python Output

py_capture_output

Capture and return Python output

py_suppress_warnings

Suppress Python warnings for an expression

Low-Level Interface

py_has_attr

Check if a Python object has an attribute

py_get_attr

Get an attribute of a Python object

py_set_attr

Set an attribute of a Python object

py_list_attributes

List all attributes of a Python object

py_call

Call a Python callable object

py_to_r r_to_py

Convert between Pyton and R objects

py_is_null_xptr py_validate_xptr

Check if a Python object is a null externalptr

py_str

An S3 method for getting the string representation of a Python object

py_iterator

Create a Python iterator from an R function

py_unicode

Convert to Python Unicode Object

py_set_seed

Set Python and NumPy random seeds

py_last_error py_clear_last_error

Get or clear the last Python error encountered

py_help

Documentation for Python Objects