Lib folder /custom modules for all commands in the extension

I want to create a lib on my computer to help me debug pyrevit extensions.
Can I define in one place that the following lines:

import os, sys
path = "/path/to/my/lib"
if os.path.exists(path) and path not in sys.path:
    sys.path.append(path)

Will they run at the beginning of every script in my extension?

Not sure, I understand,

Probably not, you are just adding a folder path to sys.path
Nothing involving every script execution.

Thank you for your response.
I wanted to be able to access my lib from any script like pyrevit can be accessed from any script, without to add it to sys.path.

ok,
it is a builtin feature

lib bin folders

put it at the root of your .extension folder
image

1 Like

One note I forgot to mention, you need to either reload or restart Revit when you do modifications in your lib folder and scripts as they are being parsed at startup

2 Likes