Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Relative path in Xlwings Pythonpath

Tags:

xlwings

Is it possible to reference the python code in the parent folder of the current folder like this:

PYTHONPATH = "../../Python_Code"

It won't work on my computer. The objective is to avoid hard coded paths.

like image 402
DauleDK Avatar asked Feb 26 '26 01:02

DauleDK


1 Answers

Indeed, you can set this like so:

PYTHONPATH = ThisWorkbook.Path & "/.."

You might need at least v0.7.0 though.

like image 94
Felix Zumstein Avatar answered Feb 28 '26 04:02

Felix Zumstein