Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

import file in another path python

# importing sys
import sys
  
# adding Folder_2 to the system path
sys.path.insert(0, '/home/amninder/Desktop/Folder_2')
  
# importing the add and odd_even 
# function
from module1 import odd_even, add
  
# calling odd_even function
odd_even(5)
  
# calling add function
print("Addition of two number is :", add(2, 2))
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #import #file #path #python
ADD COMMENT
Topic
Name
3+1 =