pyExecp: Executes a single line of Python code from within R

Description Usage Arguments Details Examples

Description

The function pyExecp is designed to execute a single line of Python code from within R. Thereby pyExecp tries to emulate the natural interactive Python terminal behavior.

Usage

1
pyExecp(code)

Arguments

code

a string of Python code to be executed in Python.

Details

The name pyExecp is short for python execute and print. As the name is indicating the most visual difference between pyExec and pyExecp lies in the printing behavior. For example, executing pyExecp('"Hello " + "R!"') would show 'Hello R!' in the R terminal, executing pyExec('"Hello " + "R!"') wouldn't show anything. Internally pyExec uses PyRun_SimpleString and pyExecp uses PyRun_String with the flag Py_single_input, therefore pyExecp can be used to simulate an interactive Python interpreter behavior.

Examples

1
pyExecp('"Hello" + " " + "R!"')


Search within the PythonInR package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.