how to import a module from a different directory in python
from folder import module
OR
import folder.module as module
how to import a module from a different directory in python
from folder import module
OR
import folder.module as module
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
Copyright © 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