This function runs Python code contained in a file. This is basically
a convenience function that is the equivalent of py.exec(readLines(file)).
py.load(file, stopOnException = TRUE)a connection or file name that will be passed to readLines to
read the Python code in the file
logical value indicating whether to check or not to
call stop if a Python exception occurs
if stopOnException is FALSE, invisibly returns a string
representation of any raised Python exceptions or NULL if none occur.
For better maintainability, it might be worth investigating concentrating
more complex Python code that needs to be called from R into proper packages
that can be installed using pip and loaded with
py.exec("import package_name").