I have found a method that is so simple it's embarrassing! Not even worthy of a name like 'Hack3'!
params.py
test_script.py
I saw references to using 'execfile' earlier but couldn't make it work and moved on. I since learned that because of the way Alibre Python is set up, the folder of execution is different the folder containing the file. So it's necessary to explicitly provide the correct path to the file.
Obviously this method is limited to use with parameters that remain constant throughout a script, but that's all was looking for. Maybe this solution was obvious to some readers of this thread but my explanations of what I was trying to achieve were not adequate.
params.py
Code:
a = 22
b = 33
c = a + b
test_script.py
Code:
import sys
Folder = "C:\\Users\\dh\Documents\\RotoAlibre\\Alibre\\Hack3"
execfile( Folder + "\\" + "params.py" )
print a, b, c
I saw references to using 'execfile' earlier but couldn't make it work and moved on. I since learned that because of the way Alibre Python is set up, the folder of execution is different the folder containing the file. So it's necessary to explicitly provide the correct path to the file.
Obviously this method is limited to use with parameters that remain constant throughout a script, but that's all was looking for. Maybe this solution was obvious to some readers of this thread but my explanations of what I was trying to achieve were not adequate.