Maya is an application that contains an embedded Python environment. This Python environment is persistent for the life of the Maya process. Things you do in the global python namespace are persistent.
So if I understand your question, you are asking about one script importing some other module, accessing a class, and changing properties on that class. And whether those changes are persistent for the life of the Maya process? Yes, when you import a module and access a class, over and over, the import mechanism in Python would be returning the already loaded module from sys.modules. So you should end up seeing the same Class object over and over again. I'm referring to the normal workflow and not what can happen if you get into forcing reloads and using the underlying python import functionality directly. But lets leave all that behavior aside.
Normally, when you do this:
from aModule import MyClass
You should end up with the same MyClass for each subsequent invocation.
But honestly, this behavior can be the same in a python-based web server, depending on how you host the application (uwsgi, fci, cgi, ..) and how many instances are running. It just depends on if two requests his the same running instance or not.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/3ee1f0e7-05b6-4012-be2b-c18a746c7c7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.