首页 > 解决方案 > 如何在 Jupiter notebook 中的 python 段落中打开 Web 浏览器

问题描述

我正在使用 Anaconda Jupyter 笔记本,在其中一段我想打开一个谷歌搜索浏览器,我不想在新标签页中打开 google.com。

使用下面的代码,我可以打开 google.com,但它会在新标签中打开。

我需要一个函数,它会在我们得到结果的输出部分打开一个网络浏览器。

我尝试了以下代码:

代码:

import webbrowser
webbrowser.open('https://www.google.com/', new=2)

请帮助,在此先感谢。

标签: pythonpython-3.xjupyter

解决方案


这个怎么样?

%%html
<iframe src="https://playground.tensorflow.org" width="1200" height="1000"></iframe>

或这个:

from IPython.display import IFrame

url = 'https://playground.tensorflow.org'
IFrame(url, width=800, height=400)

推荐阅读