revert changes in ipython_client.py

This commit is contained in:
Jeff Zhang 2019-08-05 10:31:44 +08:00
parent 2ebac75686
commit 475a91f167

View file

@ -23,23 +23,14 @@ import ipython_pb2_grpc
def run():
channel = grpc.insecure_channel('localhost:50053')
stub = ipython_pb2_grpc.IPythonStub(channel)
response = stub.execute(ipython_pb2.ExecuteRequest(code="""
from bokeh.io import output_notebook
import bkzep
output_notebook(notebook_type='zeppelin')
import hvplot.streamz
from streamz.dataframe import Random
streaming_df = Random(freq='5ms')
streaming_df.hvplot(backlog=100, height=400, width=500) +\
streaming_df.hvplot.hexbin(x='x', y='z', backlog=2000, height=400, width=500);
"""))
response = stub.execute(ipython_pb2.ExecuteRequest(code="import time\nfor i in range(1,4):\n\ttime.sleep(1)\n\tprint(i)\n" +
"%matplotlib inline\nimport matplotlib.pyplot as plt\ndata=[1,1,2,3,4]\nplt.figure()\nplt.plot(data)"))
for r in response:
print("output:" + r.output)
response = stub.execute(ipython_pb2.ExecuteRequest(code="range?"))
for r in response:
print(r)
if __name__ == '__main__':
run()