![图片[1]-python怎么打开浏览器-uusu优素-乐高,模型,3d打印,编程](http://uusucn.zbbe.cn/wp-content/uploads/2024/01/5dc3c083cd5e9660.jpg)
python打开浏览器的三种方法
1.通过导入os模块,调用startfile方法来打开浏览器。
importos
os.startfile("C:\ProgramFiles(x86)\Google\Chrome\Application\chrome.exe")
2.通过导入os模块,调用system方法来打开浏览器。
importos os.system(r'C:\"ProgramFiles(x86)"\"Google"\"Chrome"\"Application"\chrome.exe')
3.通过导入Python标准库webbrowser,调用open方法来打开浏览器。
importwebbrowser
webbrowser.open("http://www.baidu.com")原文来自:https://www.py.cn © 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END

















































暂无评论内容