Answers for "python sys.path.append current directory"

1

python add current directory to import path

import os
import sys
sys.path.append(os.getcwd())
import foo
Posted by: Guest on November-02-2021
0

sys.path.append python

sys.path is a built-in variable within the sys module. 
It contains a list of directories that the interpreter will search 
in for the required module.

APPENDING PATH- append() is a built-in function of sys module that can be 
used with path variable to add a specific path for interpreter to search. 
The following example shows how this can be done.

import sys
sys.path.append('C:/Users/Vanshi/Desktop')
Posted by: Guest on May-08-2021

Code answers related to "python sys.path.append current directory"

Python Answers by Framework

Browse Popular Code Answers by Language