运用Python的webbrowser实现定时打开特定网页

运用webbrowser库中的一个函数实现自动打开浏览器:

webbrowser.open(http://blog.csdn.net/arescnzj)

运用time库中的函数获取当前时间以及实现定时功能:

print"当前时间:%s"%time.ctime()
time.sleep(5) #定时5秒后执行

完整代码:

import webbrowser
import time
print"当前时间:%s"%time.ctime()
time.sleep(5)
webbrowser.open(http://blog.csdn.net/arescnzj)

想要学习Python?Python学习交流群:1004391443满足你的需求,资料都已经上传群文件,可以自行下载!

猜你喜欢

转载自blog.csdn.net/fei347795790/article/details/89737895