Importing functions from other custom script? #7735
-
Hello. We use a lot of custom scripts in our netbox instance, and we are at a point where we need to reuse code. Is there a way to import plain python files without building and installing as a package? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
There's nothing special about importing other Python modules from within a script; they just need to be accessible from within the Python environment. Are you sure it's within the same directory as the module importing it? Maybe try |
Beta Was this translation helpful? Give feedback.
There's nothing special about importing other Python modules from within a script; they just need to be accessible from within the Python environment. Are you sure it's within the same directory as the module importing it? Maybe try
from . import utils
.