# How to pass variable value to a python file from robotframework file?

**URL:** <https://forum.robotframework.org/t/how-to-pass-variable-value-to-a-python-file-from-robotframework-file/3050>\
**Category:** Robot Framework\
**Created:** [7 January 2022 08:08 UTC](https://forum.robotframework.org/t/how-to-pass-variable-value-to-a-python-file-from-robotframework-file/3050 "2022-01-07T08:08:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cs26](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cs26](https://forum.robotframework.org/u/cs26)\
**Post date:** [7 January 2022 08:08 UTC](https://forum.robotframework.org/t/how-to-pass-variable-value-to-a-python-file-from-robotframework-file/3050/1 "2022-01-07T08:08:05Z")

</div>

**Python file**  
_test.py_

````
```
sysman_auth = (username, password)
```

````

**Robot file**  
_sample.robot_

````
```
***Variables***
${uname} testuser
${password} testpassword
```

````

How do I pass _testuser_ and _testpassword_ from sample.robot file to test.py file?

---

<div class="post-metadata">

**Author:** ![eldaduzman](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/eldaduzman/32/1190_2.png) [@eldaduzman](https://forum.robotframework.org/u/eldaduzman)\
**Post date:** [8 January 2022 20:04 UTC](https://forum.robotframework.org/t/how-to-pass-variable-value-to-a-python-file-from-robotframework-file/3050/2 "2022-01-08T20:04:29Z")

</div>

Hi,  
If by ‘passing it to .py’ you mean using one of the functions in the .py file as a keyword, there are 2 ways to do that which I elaborated on this article - [Extend robotframework using the robotframework python lib core | by Eldad Uzman | Medium](https://eldadu1985.medium.com/extend-robotframework-using-the-robotframework-python-lib-core-bf73e09160d3)

If instead you mean running the .py file as a script with arguments then you need to execute it in a different process and you can do that with robot frameworks operating system library - [OperatingSystem - Documentation](https://robotframework.org/robotframework/2.1.2/libraries/OperatingSystem.html)
