Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python
String Question
 

Index | Next | Previous | View Flat


diffuser78 at gmail

Jun 28, 2006, 8:35 AM


Views: 388
Permalink
String Question

mac_string = '001485e55503' (This is the mac address of a computer.)

I am using wake on LAN python script to start computer remote.It uses
format like this ....

s.sendto('\xff'*6 + '\x00\x014\x85\xe5\x55\x03'*16, ('192.168.1.255',
80))

where '\x00\x14\x85\xe5\x55\x03' is the MAC address to be used.


What I do is break the string into 6 parts like this,

str01=mac_string[0:2]
str02=mac_string[2:4]
str03=mac_string[4:6]
str04=mac_string[6:8]
str05=mac_string[8:10]
str06=mac_string[10:12]

and if I use it like this

s.sendto('\xff'*6 + '\xstr01\xstr02\xstr03\xstr04\xstr05\xstr06'*16,
('192.168.1.255', 80))
I get an error


I also tried like this
s.sendto('\xff'*6 + 'mac_string'*16, ('192.168.1.255', 80))

Thiis also didnt work.


Since the MAC adddress are hexadecimal, how should I go about it here.

Please help, every help is appreciated. Thanks

--
http://mail.python.org/mailman/listinfo/python-list

Subject User Time
String Question diffuser78 at gmail Jun 28, 2006, 8:35 AM
    Re: String Question fredrik at pythonware Jun 28, 2006, 8:45 AM
    Re: String Question iainking at gmail Jun 28, 2006, 8:48 AM
    Re: String Question diffuser78 at gmail Jun 28, 2006, 8:56 AM
    Re: String Question diffuser78 at gmail Jun 28, 2006, 8:59 AM
    Re: String Question martin at v Jun 28, 2006, 9:38 AM
    Re: String Question timr at probo Jun 29, 2006, 11:57 PM
        Re: String Question iainking at gmail Jun 30, 2006, 1:09 AM
    Re: String question root at sys1 Jun 23, 2008, 7:54 AM
    Re: String question root at sys1 Jun 23, 2008, 3:13 PM
        Re: String question M8R-yfto6h at mailinator Jun 23, 2008, 8:38 PM
            Re: String question cokofreedom at gmail Jun 24, 2008, 12:53 AM
    Re: String question tjreedy at udel Jun 24, 2008, 11:40 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.