7 Star 21 Fork 5

李波 / wakeonlan

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

空文件

简介

可以通过pc发送唤醒包 展开 收起
Python
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/libolink/wakeonlan.git
git@gitee.com:libolink/wakeonlan.git
libolink
wakeonlan
wakeonlan
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891