首页 > 解决方案 > 让 Python 检测一个站点是否在 PC 上处于活动状态

问题描述

好的,所以我正在制作一个脚本,如果您访问某个站点,它会在 Windows 10 中为您提供通知。

举个例子:你去这样的网站:twitter.com,然后 Python 脚本会检测到它并运行另一个脚本(通知脚本)。

这是通知脚本:

import time

from win10toast import ToastNotifier
toaster = ToastNotifier()
toaster.show_toast("Distracting",
                   "You are now going on a disstracting site.",
                   icon_path=None,
                   duration=5,
                   threaded=True)

标签: pythonpython-3.xnotifications

解决方案


推荐阅读