import python module from same directory code example
Example 1: how call module in the same directory
from .posts_run import get_all_posts
# ^ here do relative import
# or
from core.posts_run import get_all_posts
# because your package named 'core' and importing looks in root folder
Example 2: import python module from another directory
import sys
# sys.path is a list of absolute path strings
sys.path.append('/path/to/application/app/folder')
import file
Example 3: importing python module from different directory
# test.py
import sys
# append current python modules' folder path
# example: need to import module.py present in '/path/to/python/module/not/in/syspath'
sys.path.append('/path/to/python/module/not/in/syspath')
import module