Python in shiny app

Using a command like this `reticulate::source_python("")

But sourcing your python code each time you press a button doesn't sound like a good idea, it would be better to source your python function at session level and then use that function in your button as it was regular R code.

If you need more specific help please provide a minimal reproducible example (reprex) illustrating your issue. Have a look at this guide, to see how to create one for a shiny app