Getting Variables into and out of Python

First off, you guys deserve major applause for implementing Python.  It's a major hassle to translate my thoughts (which are mostly in Python) into JavaScript or VB.

However, I am using Python 2.5.4 with FB 6.3, and can't seem to get variable values between Python and the FinalBuilder script, which was the major purpose of the exercise.

To wit, when I try to refer to a Project variable from python, the 'Run Script' action fails.  It complains that the variable does not exist.  I tried "print vars()" and there are a ton of variables set -- just not any of the FB variables (or anything related to FB) that I can tell.

I am allowed to assign to a variable with the same name as a project variable, but that is just python being nice.  You can define a variable with any name in python.  The value does not get back to the FB script.

(For grins, I pointed the Python lib dir to Python24 and Python26 )

 

Hi Miles

You should be able to use the ATVariables collection, however when I tested this it wasn’t working. This has now been fixed in this build :

http://www.automise.com/downloads/automise/300/AT300_625.exe

Example :

print ATVariables[“sysdir”]

ATVariables[“myvariable”] = “hello world”