In [ ]:
import Pyro4.utils.flame
Pyro4.config.SERIALIZER = "pickle" # flame requires pickle serializer
flame = Pyro4.utils.flame.connect("localhost:9999") # or whatever the server runs at
In [ ]:
# basic stuff
socketmodule = flame.module("socket")
osmodule = flame.module("os")
print("remote host name=", socketmodule.gethostname())
print("remote server current directory=", osmodule.getcwd())
flame.execute("import math")
root = flame.evaluate("math.sqrt(500)")
print("calculated square root=", root)
try:
print("remote exceptions also work...", flame.evaluate("1//0"))
except ZeroDivisionError:
print("(caught ZeroDivisionError)")
In [1]:
import sys
sys.path.append('Net/rpc_sensors')
In [2]:
%load_ext flamemagic
In [4]:
%reload_ext flamemagic
In [8]:
%%flame
h = 'hi'
print(h)
print(h*5)
out=h
In [6]:
%%flame
import sys
if sys.version_info < (3, 0):
from cStringIO import StringIO
else:
from io import StringIO
oldout = sys.stdout
sys.stdout = StringIO()
h = 'hi '
print(h)
print(h*10)
out = sys.stdout.getvalue()
sys.stdout.close()
sys.stdout = oldout
#print(out)
In [ ]:
print('hi \nhi hi hi hi hi hi hi hi hi hi \n')
In [ ]:
'hi \nhi hi hi hi hi hi hi hi hi hi \n'
In [ ]: