如何使用Jupyter内核网关API返回二进制文件-Python ipynb

时间:2018-11-09 15:38:22

标签: python jupyter-notebook jupyter

我创建了一个笔记本(Python代码),该笔记本使用Jupyter内核网关API(kernel_gateway.notebook_http)发布,用于请求。如果响应是字符串或JSON,我可以使用print回复http请求。

如何使用Python从笔记本中回复二进制文件(例如PDF)?我不能使用print,因为它需要一个字符串并且sys.stdout.buffer.write(...)不可用。

0 个答案:

没有答案
相关问题