just remove this
this line is redundant if you are not going to run the module as stand alone script. I don't know if it resolve your problem (I didn't look into details) but as is it will cause problem when function is imported
To get understanding of what
module1:
if __name__ == '__main__':
and adjust the indentationsthis line is redundant if you are not going to run the module as stand alone script. I don't know if it resolve your problem (I didn't look into details) but as is it will cause problem when function is imported
To get understanding of what
if __name__ == '__main__':
is doing comparemodule1:
def foo(): print('This is print from inside function foo') foo()module2:
def foo(): print('This is print from inside function foo') if __name__ == '__main__': foo()run and import each of the two modules to see the difference
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs