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 fileimport 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 filehow to import file from another directory in python
import sys
# sys.path is a list of absolute path strings
sys.path.append('/path/to/application/app/folder') # <-- relative path
import your_fileimporting 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 moduleimport python file from another directory
from application.app.folder.file import func_nameCopyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us
