# VS Code problem with a variable defined in .py file

**URL:** <https://forum.robotframework.org/t/vs-code-problem-with-a-variable-defined-in-py-file/6511>\
**Category:** Robot Framework\
**Created:** [24 November 2023 10:15 UTC](https://forum.robotframework.org/t/vs-code-problem-with-a-variable-defined-in-py-file/6511 "2023-11-24T10:15:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hyytiainen](https://avatars.discourse-cdn.com/v4/letter/h/ecd19e/32.png) [@hyytiainen](https://forum.robotframework.org/u/hyytiainen)\
**Post date:** [24 November 2023 10:15 UTC](https://forum.robotframework.org/t/vs-code-problem-with-a-variable-defined-in-py-file/6511/1 "2023-11-24T10:15:04Z")

</div>

Hi,

I am using VS Code with Robot Framework Language Server and Robocorp Code. Now I faced an issue where I have following variables defined in .py file:

CORE\_PATH = os.path.dirname(os.path.realpath( **file** ))  
TEST\_SYSTEM\_PATH, \_ = os.path.split(CORE\_PATH)  
LIBRARIES\_PATH = os.path.join(TEST\_SYSTEM\_PATH, “Libraries”)

In test.robot file TEST\_SYSTEM\_PATH variable is shown as Undefined variable, other two variables are ok.

The variable is considered to be ok in VS Code if it is defined as follows:  
temp\_path, \_ = os.path.split(CORE\_PATH)  
TEST\_SYSTEM\_PATH = temp\_path

So is this an issue in Robot Framework Language Server or Robocorp Code? Or something else?

Br,  
Sami
