#' @export
run_script <- function(x, work_dir = NULL, local = FALSE, convert = FALSE){
if(length(work_dir) == 1 && dir.exists(work_dir)){
`_cwd` <- getwd()
on.exit({setwd(`_cwd`)}, add = TRUE, after = TRUE)
work_dir <- normalizePath(work_dir)
setwd(work_dir)
}
x <- normalizePath(x, mustWork = TRUE)
ravepy::ensure_ravepy()
reticulate::py_run_file(file = x, local = local, convert = convert)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.