If you have a file called "test.py" that has the variables defined in it, you can import the variables using the variable file feature.
Here's an example using a pipe split format for clarity:
*** Settings ***
| Variables | test.py
*** Variables ***
| ${myTestName} | ${var}
, Variables. python (: python variable var ${var})
, , ${Testname} , . , , , ${myTestName}.