On Tue, 11 Oct 2016, 9:24 PM <s...@weacceptyou.com> wrote:
> i am calling a module which creates a variable, i dont need to return this
> variable to the main script once the module is done its job. But does this
> mean the next time the module is called that variable created before is
> removed from memory?
It seems that some of your terms are mixed up so it's hard to know what you
might be referring to. Modules aren't callable, and are a container usually
representing objects parsed from a file loaded into the interpreter (but
there are other sources).
Do you actually mean global variables in a module? Or do you mean local
variables created within a function that lives within a module?
Variables created in the global scope of the module will live for as long
as the module stays loaded in the interpreter. This is really just a fancy
term for it living in sys.modules, and also once no one keeps a reference
Variables created in the scope of a function body are local to that
function and are destroyed when the stack frame of that function call is
cleaned up, at the end of the function.
> 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_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> For more options, visit https://groups.google.com/d/optout.
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 view this discussion on the web visit
For more options, visit https://groups.google.com/d/optout.