Skip to content

图像输出为空 #59

@papers-web

Description

@papers-web

我想测试一下程序对画图是如何处理的:

于是我在jupyter_backend.py下面加上了main函数:

if __name__ == '__main__':
    kernel = JupyterKernel("./cache/")
    img_code = """
    import matplotlib.pyplot as plt
        x = [1, 2, 3, 4, 5]
        y = [2, 3, 5, 7, 6]

        plt.plot(x, y)

        plt.title('Simple Line Plot')
        plt.xlabel('X-axis')
        plt.ylabel('Y-axis')
        plt.show()
        """
    res = kernel.execute_code(img_code)
    print(res)

但是发现最终打印的res是('', []). Debug发现上面iopub_msg = self.kernel_client.get_iopub_msg(timeout=1)无法捕捉到图像的信息。想请问一下,你们是如何实现输出图像的呢?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions