网络编程
位置:首页>> 网络编程>> Python编程>> 运用Python的webbrowser实现定时打开特定网页

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

作者:AresCNZJ  发布时间:2021-12-15 23:07:02 

标签: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)

来源:https://blog.csdn.net/AresCNZJ/article/details/64132552

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com