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 @ 2017-03-28 13:57  DevOps_QXW  阅读(16732)  评论(0编辑  收藏  举报