using stringProperty (subtype = DIR_PATH) and os.walk

i use a stringProperty with subtype = DIR_PATH to choose a file-path in blender

when i select a path, it opens a window where you can choose the path now (in my example i choose /home/linux/Blender/)

it only shows “//…/…/…/…/…/…/Blender/” outside the window where you can choose it and when i try to access the selected path
i get “//…/…/…/…/…/…/Blender/” too.

but now i want to use this value in os.walk

for root, dir, files in os.walk(directory):

but this seems not to work.

is there a way to convert it to the right “value”??

try:

os.path.realpath(bpy.path.abspath(path))