python打开浏览器的三种方法

1.startfile方法

import os
os.startfile("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")

2.system方法

import os
os.system(r'C:\"Program Files (x86)"\"Google"\"Chrome"\"Application"\chrome.exe')

3.更好地解决方案WEBBROWER

import webbrowser
webbrowser.open("http://www.baidu.com")
posted @ 2018-04-21 16:19  lili414  阅读(4716)  评论(0编辑  收藏  举报