Python short-trick to load any local directory as python module in script

import logging
from pathlib import Path
# add this section to your script before listing your cutom modules
script_parent_package_path = Path(__file__).resolve().parents[1] # get one level above folder path
# add current directory
if script_parent_package_path:
sys.path.append(str(script_parent_package_path))y
# load your custom modules# write your code

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store