mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
revert changes in ipython_client.py
This commit is contained in:
parent
2ebac75686
commit
475a91f167
1 changed files with 5 additions and 14 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue