Passing a robot variable to Python Variable file

Hello please I am bloqued on a topic I need your help,

So I have this robot line {My Account number}= get text xpath:{Account number} that get’s me the created account number, I need to passe the result to my data.py file as follow:
#test.py
NumCompte = ${My Account number} (since it contains my data)

Thanks for your help I am open to other solutions (thinking outside the box)

It may depend on how you use data.py.

If you change it after being imported as variables file, it will not use the new value.

If that is the case, then it’s better to reassign ${NumCompte} and make it global.

A variable file is loaded when robot imports it.
You could try to work with properties, but i would assume, that it is a one way thing.
Just getting variables from python module or class.

I don’t think that if you change a variable, this variable is passed back to the module.
But maybe it is.

On the other hand, why do you Not use a python library with a keyword.
And this keyword takes as argument your data and returns what ever it has to return?