Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

图像输出为空 #59

Open
Xwords-cmd opened this issue Aug 14, 2024 · 0 comments
Open

图像输出为空 #59

Xwords-cmd opened this issue Aug 14, 2024 · 0 comments

Comments

@Xwords-cmd
Copy link

Xwords-cmd commented Aug 14, 2024

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

于是我在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)无法捕捉到图像的信息。想请问一下,你们是如何实现输出图像的呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant