notebook笔记

时间:2024-01-15 20:45:32

启动

__main__.py

静态文件

static/

模板

templates/

路由

比如tree/handlers.py default_handlers

WebSocket

ws://localhost:8888/api/kernels/f0164f9e-87c4-4fb8-a730-454c88dd6b8a/channels?session_id=C922A49A336C46739A4A94CEB11C65A5

notebook/services/kernels/handlers.py

default_handlers->ZMQChannelsHandler->on_message->self.session.send(<jupyter_client.session.Session object at 0x1048c1be0>)->

jupyter_client/session.py

Session->send->stream.send_multipart(<bound method ZMQStream.send_multipart of <zmq.eventloop.zmqstream.ZMQStream object at 0x104881080>>)

zmq/eventloop/zmqstream.py

ZMQStream->send_multipart->self._send_queue.put((msg, kwargs))->self._send_queue = Queue()->(import queue as qqq print(qqq) <module 'queue' from '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/queue.py'>)