def loadValueFromFile(filename, variable, passphrase=None):
 if passphrase:
  mode = 'rb'
 else:
  mode = 'r'
 fileObj = open(filename, mode)
 d = {'__file__': filename}
 if passphrase:
  data = fileObj.read()
  data = _decrypt(passphrase, data)
  exec data in d, d
 else:
  exec fileObj in d, d
 value = d[variable]
 return value

def loadValueFromFile ( filename , variable , passphrase = None ) : if passphrase : mode = 'rb' else : mode = 'r' fileObj = open ( filename , mode ) d = { '__file__' : filename } if passphrase : data = fileObj . read ( ) data = _decrypt ( passphrase , data ) exec data in d , d else : exec fileObj in d , d value = d [ variable ] return value
load the value of a variable in a python file .