tests/testthat/resources/use-python.R

n <- 1

python <- Sys.which("python")
if(!nzchar(python))
  python <- Sys.which("python3")

res <- system2(python,
               c("-c", shQuote(sprintf("print(%i+1)", n))), stdout = TRUE)
stopifnot(identical(res, as.character(n + 1)))

Try the guildai package in your browser

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

guildai documentation built on March 7, 2023, 5:32 p.m.