Wake-on-LAN via Python?

Gerhard Häring gerhard.nospam at bigfoot.de
Tue Aug 14 20:35:08 EDT 2001


On Tue, 14 Aug 2001 23:19:49 GMT, Bablos <angband at blueyonder.co.uk> wrote:
>Hi There...
>
>Has anyone managed to implement Wake-on-LAN via Python?

I did at a time, but it got lost :-(

>I assume it's possible, but I'm not sure what kind of programming would be
>involved, and what kind of information would need to be sent to a machine on a
>LAN in order to wake it up.

You can search for wake on LAN on http://freshmeat.net The first and only hit
is a Perl script that does just that.

>Hope someone can point me in the right direction!

The Perl script needs the ARP address of the target machine and the broadcast
address of the packet. It then constructs a "magic packet" and sends this via
UDP to the broadcast address.

Somebody who can read a bit of Perl cuold translate the Perl code to Python,
it's only a few lines.

Gerhard
-- 
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    public key at homepage
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))



More information about the Python-list mailing list