I am trying to create a Shiny app where a user will choose a short string from a drop-down menu, that string will then be passed to a python script which will output some values which will be used in the shiny app.
Using reticulate's py_run_file
function with the needed values hardcoded works great. However, using this:
py_run_file('test_script.py arg1')
gives this:
Error in py_run_file_impl(file, local, convert)
:
Unable to open file 'test_script.py arg1' (does it exist?)
Several threads suggest using a system()
call to run a .py
script with command line arguments but I don't think that would be feasible for the goals because the argument needs to be able to change. Other threads have suggested creating a python file that calls the original python file using os.system()
with arguments, but that also doesn't work for my situation.
Does anyone have any ideas?
Thanks