1 Star 2 Fork 2

刘彬彬/小知识_自动化任务脚本_DhanushNehru

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

WiFi Connection Checker and Restarter

Overview

This Python script is designed to check the status of your WiFi connection on a Windows system. If the WiFi network is inactive and not able to receive ping packets, the script will automatically turn off the WiFi, turn it on again, and check whether the connection is live again or not. The script utilizes the schedule package for task scheduling, netsh commands for controlling the WiFi interface, and the netifaces package to retrieve meaningful network interface names.

Prerequisites

  • This script is specifically designed for Windows systems.
  • The script requires administrative privileges to perform actions like turning off and on the WiFi interface.

Dependencies

Install the schedule and netifaces packages using the following commands:

pip install schedule
pip install netifaces

Usage

  1. Run the script with administrative privileges to ensure it can control the WiFi interface.
  2. python wifi_checker.py
  3. The script will schedule a periodic check of the WiFi connection status.
  4. If the WiFi connection is inactive (unable to receive ping packets), the script will automatically turn off and on the WiFi interface.
  5. The script will log the status of the WiFi connection in the console.

Important Notes

  • Ensure that the script is run with administrative privileges to avoid permission issues.
  • The script uses the netsh command to control the WiFi interface. If there are any issues with the execution of netsh, the script may not work as expected.

References

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/liu_binbin/some_python_scripts.git
git@gitee.com:liu_binbin/some_python_scripts.git
liu_binbin
some_python_scripts
小知识_自动化任务脚本_DhanushNehru
master

搜索帮助