kush
0
Q:

how to import your own function python

#For one particular fuction,
from fileName import function1()
fileName.function1()
#For multiple functions,
from fileName import function1(), function2()
fileName.function1()
fileName.function2()
#For all functions (or to remove the "fileName." prfix),
from fileName import *
function1()
function2()
function3()
#(You don't need to call all of them, I'm just demonstrating)
0
#If you want to import all functions from file... but you will still need to
#mention the file name:
import pizza
pizza.pizza_function()

#If you want to import every function but you dont want to mention file name:
from pizza import *
pizza.pizza_function()
4
from file.py import function(a,b)
-1

New to Communities?

Join the community