Posted on 10th September 2024|51 views
How can I call a function from another file in python?
Posted on 10th September 2024| views
There are three steps to follow
Here is the example a python file example.py is created and it has showMsg() function.
#example.py
def showMsg():
print( "mindmajix")
Now let us create another python file that calls the showMsg() function defined in example.py
# functions defined within example.py
from test import *
showMsg()
Output:
mindmajix