如何确保我们在Web浏览器中只使用python打开了一个给定页面的实例

时间:2015-11-03 23:32:23

标签: python browser web

例如,我想使用python(完全是webbrowser模块)在浏览器中打开HTML文件,但我希望该页面位于活动选项卡中,并且只应在整个Web浏览器中打开该页面的一个实例。 / p>

这是我使用

的简单python代码
import webbrowser

def openWebPage(url):
    webbrowser.open(url)


## before opening the html page i want to make sure 
## it is not opened already, otherwise select it and make it the active tab

openWebPage('/var/www/html/index.html')

0 个答案:

没有答案
相关问题