Hello, I have a few question concerning the use of if __name__ == "__main__":
From what I gathered, it is used to make a module to both work as a module and as a standalone.
Here's my stoopid.py
def print_message(m):
""" print m message in python window """
print m
if __name__ == "__main__":
print_message("It worked!")
outside maya, if I run stoopid.py, it'll print "it worked" as it suposed to.
I can also import the stoopid module,
and use stoopid.print_message(m)
So thats good.
In maya script editor, I can only import it as a module and run the def.
import stoopid
stoopid.print_message("HEY")
That'll work fine.
I've tried to find example but cant find the right way to just run the .py inside maya script editor so that it would trigger it as a standalone application.
Is there such a way, or is maya preventing this somehow?
Thanks