Robot Framework: access Robot's global variables from Python library code?
You will want to use rf's BuiltIn
library, for reference read the documentation as found here. This provides the keywords that are built into Robot Framework and so should reliably stay usable:
from robot.libraries.BuiltIn import BuiltInresults_path = BuiltIn().get_variable_value("${RESULTS_PATH}")