View source: R/run_python_script_with_args.R
| run_python_script_with_args | R Documentation |
Run a Python script with command-line arguments
run_python_script_with_args( python_script_path, args = c(), ormr_folder_name = get_default_ormr_folder_name(), python_version = get_default_python_version(), verbose = FALSE )
python_script_path |
path to a Python script |
args |
arguments to a script, for example |
ormr_folder_name |
can be either |
python_version |
the version of Python used. Use get_default_python_version to get the default Python version. |
verbose |
the verbosity of a function. Set to TRUE for more output. Use check_verbose to detect if this argument is valid. |
The output of the Python script
Richèl J.C. Bilderbeek
use run_python_script to run a Python script without command-line arguments
if (plinkr::is_on_ci()) {
if (is_conda_installed()) {
ormr_folder_name <- create_default_conda_env()
} else {
# Use local python
ormr_folder_name <- "python3"
}
python_script_path <- system.file(
"extdata", "show_args.py", package = "ormr"
)
run_python_script_with_args(
ormr_folder_name = ormr_folder_name,
python_script_path = python_script_path,
args = c("Hello", "world")
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.