(filename, globals, locals=None)
Python 3 implementation of execfile.
Python 3 implementation of execfile.
Python 3 implementation of execfile .
def _execfile(filename, globals, locals=None):
    """
    Python 3 implementation of execfile.
    """
    mode = 'rb'
    with open(filename, mode) as stream:
        script = stream.read()
    if locals is None:
        locals = globals
    code = compile(script, filename, 'exec')
    exec(code, globals, locals)
def _execfile ( filename , globals , locals = None ) : mode = 'rb' with open ( filename , mode ) as stream : script = stream . read ( ) if locals is None : locals = globals code = compile ( script , filename , 'exec' ) exec ( code , globals , locals )