Skip to content

Instantly share code, notes, and snippets.

@hpk42
Created November 19, 2013 20:51
Show Gist options
  • Save hpk42/7552330 to your computer and use it in GitHub Desktop.
Save hpk42/7552330 to your computer and use it in GitHub Desktop.
import execnet
def execnet_main(channel):
import inspect
import sys
f = sys._getframe()
frames = []
while f:
frames.append((
inspect.getfile(f),
inspect.getsourcefile(f)))
f = f.f_back
channel.send(frames)
x = len(inspect.getouterframes(inspect.currentframe()))
channel.send(x)
if __name__ == '__main__':
import pprint
gw = execnet.makegateway('popen')
ch = gw.remote_exec(execnet_main)
pprint.pprint (ch.receive())
print (ch.receive())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment