def execfile(filename, globals, locals=None):
 if (locals is None):
  locals = globals
 with open(filename, 'rbU') as fin:
  source = fin.read()
 code = compile(source, filename, 'exec')
 exec code in globals, locals

def execfile ( filename , globals , locals = None ) : if ( locals is None ) : locals = globals with open ( filename , 'rbU' ) as fin : source = fin . read ( ) code = compile ( source , filename , 'exec' ) exec code in globals , locals
execute a python script in the given namespaces .