Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to import from parent directory

import sys
  
# setting path
sys.path.append('../parentdirectory')
  
# importing
from parentdirectory.geeks import geek_method
  
# using
geek_method()
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #import #parent #directory
ADD COMMENT
Topic
Name
6+8 =