def execfile(fname, glob=None, loc=None, compiler=None): if isinstance(fname, unicode): filename = fname.encode(sys.getfilesystemencoding()) else: filename = fname where = [ns for ns in [glob, loc] if ns is not None] if compiler is None: builtin_mod.execfile(filename, *where) else: scripttext = builtin_mod.open(fname).read().rstrip() + "\n" exec(compiler(scripttext, filename, "exec"), glob, loc)
def execfile(fname, glob=None, loc=None, compiler=None): if isinstance(fname, unicode): filename = fname.encode(sys.getfilesystemencoding()) else: filename = fname where = [ns for ns in [glob, loc] if ns is not None] if compiler is None: builtin_mod.execfile(filename, *where) else: scripttext = builtin_mod.open(fname).read().rstrip() + '\n' exec(compiler(scripttext, filename, 'exec'), glob, loc)
def dispatch_script(msg, ses): # print("leoremote.py: dispatch script", msg) fd, pth = tempfile.mkstemp(suffix='.py') f = os.fdopen(fd,"w") f.write(msg) f.close() # first run if 'pydict' not in ses: ses['pydict'] = {'g' : g } # print("run file",pth) if g.isPython3: g.trace('no python 3 support') # exec(compile(script, scriptFile, 'exec'), d) else: builtins.execfile(pth, ses['pydict'])
def dispatch_script(msg, ses): # print("leoremote.py: dispatch script", msg) fd, pth = tempfile.mkstemp(suffix='.py') f = os.fdopen(fd, "w") f.write(msg) f.close() # first run if 'pydict' not in ses: ses['pydict'] = {'g': g} # print("run file",pth) if g.isPython3: g.trace('no python 3 support') # exec(compile(script, scriptFile, 'exec'), d) else: builtins.execfile(pth, ses['pydict'])
def execfile(fname, *where): if isinstance(fname, unicode): filename = fname.encode(sys.getfilesystemencoding()) else: filename = fname builtin_mod.execfile(filename, *where)
def run_remote_script(fname): # c and p are ambiguous for remote script print("rrs") d = {'g': g } builtins.execfile(fname, d)
def run_remote_script(fname): # c and p are ambiguous for remote script print("rrs") d = {'g': g} builtins.execfile(fname, d)