I create a python function in a file and filename is ifunc.py
def func():
print('print something')
I have my main program in another file like this:
import ifunc
inputFlag = input('input something:')
if inputFlag == 1:
ifunc.func()
and this produce nothing, but when I try to import the function outside the if statement like:
import ifunc
ifunc.func()
the print message print something will show up.
So how could I make the print message show up when the called function inside the if statement?
Please give me some advice. Thanks in advance!