Answers for "how to add directory to python path"

1

save pythonpath

export PYTHONPATH="${PYTHONPATH}:/my/other/path"
Posted by: Guest on June-26-2020
0

add dir to path python

import sys
sys.path.insert(0,'/path/to/mod_directory')
Posted by: Guest on August-26-2021
-1

how to add directory to python script

import os

# List all files in a directory using scandir()
basepath = 'my_directory/'
with os.scandir(basepath) as entries:
    for entry in entries:
        if entry.is_file():
            print(entry.name)
Posted by: Guest on June-17-2020

Code answers related to "how to add directory to python path"

Python Answers by Framework

Browse Popular Code Answers by Language