def importAndRunFunction(path, moduleName, funcName, **keywords):
 import sys
 originalPath = sys.path
 try:
  augmentedPath = ([path] + sys.path)
  sys.path = augmentedPath
  func = getattr(__import__(moduleName, fromlist=[funcName]), funcName)
  sys.path = originalPath
 except:
  sys.path = originalPath
  raise
 return func(**keywords)

def importAndRunFunction ( path , moduleName , funcName , ** keywords ) : import sys originalPath = sys . path try : augmentedPath = ( [ path ] + sys . path ) sys . path = augmentedPath func = getattr ( __import__ ( moduleName , fromlist = [ funcName ] ) , funcName ) sys . path = originalPath except : sys . path = originalPath raise return func ( ** keywords )
run a named function specified by a filesystem path .