# Variable file usage in python

**URL:** <https://forum.robotframework.org/t/variable-file-usage-in-python/3318>\
**Category:** Robot Framework\
**Created:** [22 February 2022 09:39 UTC](https://forum.robotframework.org/t/variable-file-usage-in-python/3318 "2022-02-22T09:39:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrr\_robot](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@mrr\_robot](https://forum.robotframework.org/u/mrr_robot)\
**Post date:** [22 February 2022 09:39 UTC](https://forum.robotframework.org/t/variable-file-usage-in-python/3318/1 "2022-02-22T09:39:58Z")

</div>

If i have a variable file (arguments.py):  
variables1 = {‘scalar’: ‘Scalar variable’,  
‘LIST\_\_list’: [‘List’,‘variable’]}  
variables2 = {‘scalar’ : ‘Some other value’,  
‘LIST\_\_list’: [‘Some’,‘other’,‘value’],  
‘extra’: ‘variables1 does not have this at all’}

def get\_variables(arg):  
if arg == ‘one’:  
return variables1  
else:  
return variables2

And I run test with parameter --variablefile arguments.py:two .\test.robot

I have a python file database.py

How can I access/read the correct value “extra” in my python file?

Should I import arguments.py in database.py?

Can it be read what is the parameter in use (“two”) when test is started?

---

<div class="post-metadata">

**Author:** ![mrr\_robot](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@mrr\_robot](https://forum.robotframework.org/u/mrr_robot)\
**Post date:** [23 February 2022 05:33 UTC](https://forum.robotframework.org/t/variable-file-usage-in-python/3318/2 "2022-02-23T05:33:42Z")

</div>

I think I solved this with this:  
BuiltIn().get\_variable\_value(’${VAR}’),
