Maybe this helps: You do not need to use Python. You can call any API directly from within Ui.Vision.
Or do you want/need to use Python? XRunAndWait supports command line parameters (3rd column in the table view). So you can send the values as command line parameters to Python.