Forum: Poser Python Scripting


Subject: Defense from other script

JTrout opened this issue on Sep 11, 2010 · 7 posts


3dvice posted Mon, 13 September 2010 at 6:07 AM

I just started with Python a little while ago, so I'm probably not the right person to answer your question, but I'll give it a try and maybe somebody else will join in to give more detailed or better answer:

 

Quote - Is each script execution in the same process/name_space unless the Poser is finished?

 

Yes.- The variable and its value stays alive, even when your script is finished, and the value can be changed/overwritten by another script.
 
  > Quote - What kind of coping (self-defense) is possible for the programmer to such a problem which occurs from other's scripts?

 

You can  initialize/define your variables inside a function or encapsulate them in an object.

Le cinéma substitue à notre regard un monde qui s'accorde à nos désirs. - André Bazin