# wakeonlan **Repository Path**: libolink/wakeonlan ## Basic Information - **Project Name**: wakeonlan - **Description**: 可以通过pc发送唤醒包 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 21 - **Forks**: 5 - **Created**: 2019-02-13 - **Last Updated**: 2023-09-06 ## Categories & Tags **Categories**: nms **Tags**: None ## README ######### wakeonlan ######### 一个python制作的魔术唤醒包工具 ***** 安装wakeonlan模块 ***** 执行下面2行命令,生成安装包,然后切换到dist目录, 使用第3行命令安装包。 安装以后就可以用cmd输入wakeonlan命令测试使用。 1.python setup.py bdist_egg 2.python setup.py sdist 3.pip install wakeonlan-0.1*.tar.gz 注意:要想唤醒成功,必须把目标主机BIOS和电源相关设置弄好,具体可以百度。 ****************** 作为模块使用 ****************** - Import the module >>> from wakeonlan.wakeonlan import * - Wake up a single computer by its mac address >>> send_magic_packet('ff.ff.ff.ff.ff.ff') - Wake up multiple computers by their mac addresses. >>> send_magic_packet('ff.ff.ff.ff.ff.ff', '00-00-00-00-00-00', ... 'FFFFFFFFFFFF') - An external host may be specified. Do note that port forwarding on that host is required. The default ip address is 255.255.255.255 and the default port is 9. >>> send_magic_packet('ff.ff.ff.ff.ff.ff', ... ip_address='example.com', ... port=1337) ********************** 作为命令行使用 ********************** :: usage: wakeonlan [-h] [-i ip] [-p port] mac address [mac address ...] Wake one or more computers using the wake on lan protocol. positional arguments: mac address The mac addresses or of the computers you are trying to wake. optional arguments: -h, --help show this help message and exit -i ip The ip address of the host to send the magic packet to. (default 255.255.255.255) -p port The port of the host to send the magic packet to (default 9) ************ Dependencies ************ Python3.x