inst/testing/PyFunction.R

#' # pyImport
require(testthat)
require(PythonInR)
invisible(capture.output(pyConnect()))

expect_that(pyExec("import os"), equals(0))
fun <- pyFunction("os.getcwd")
expect_that(class(fun), equals("pyFunction"))
expect_that(fun(), equals(getwd()))

Try the PythonInR package in your browser

Any scripts or data that you put into this service are public.

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