Hi there,
I’m trying to read variables from an external python script within a VC-python script.
For example:
In externalscript.py:
X = 1
=====================
In VC Python Script:
import externalscript
print externalscript.X
=====================
This will print me “1”, but if I change the value of X with a python program outside VC, the VC-script will keep print “1” each time I call “print externalscript.X”. If I restart VC and call “print externalscript.X”, it will print me the new value that was assign from the external python.
Also, even if I delete the “import externalscript” row in VC-Script, and then call “print externalscript.X”, it will keep printing the value of X, till the point I restart VC. (I get the feeling here that the import command saves the stuff temporarely somewhere and this is why I keep getting the old values? Even a new import command will not give me the new value of X though?!)
However, if I assign externalscript.X a new value from the VC python script, and call “print externalscript.X”, it will print me the new that I assigned from the VC-script.
Is there a way to read the variable from a VC- script and keep updating the same variable with another python program, and get the new updated value from the VC-script?
It would really me help alot if there is a way to do it this way.