Search
 
SCRIPT & CODE EXAMPLE
 

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))
Comment

PREVIOUS NEXT
Code Example
Python :: how to get django 
Python :: python test module 
Python :: literal_eval in python 
Python :: python count how many times a word appears in a string 
Python :: matplot image axis 
Python :: delete plotted text in python 
Python :: Iterating With for Loops in Python 
Python :: turn string into operator python 
Python :: pandas df tail 
Python :: pandas find fifth caracter in field and change cell based on that number 
Python :: python dictionary input 
Python :: delete content of table django 
Python :: python Using for loop and list comprehension 
Python :: Python NumPy delete Function Syntax 
Python :: joining lists python 
Python :: program to replace lower-case characters with upper-case and vice versa in python 
Python :: How to perform topological sort of a group of jobs, in Python? 
Python :: opening a file in python 
Python :: how to code a funtion in python 
Python :: list programs in python 
Python :: python calendar table view 
Python :: docker compose cron 
Python :: django button 
Python :: loops in python 
Python :: pytest fixture 
Python :: space complexity python 
Python :: string manipulation in python 
Python :: reaction role discord.py 
Python :: python online compiler 
Python :: cache-control no cache django 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =