String to binary python
===

This is probably a dummy question for most of you, but i'm facing this problem;

I'm capturing a mac address on the network with scapy,I convert this mac address to "\x00\x21\x23\x24\x25" this way :

    ...
      b = p.sprintf("%Dot11.addr2%")
      print "Sending to this MAC Address",b
      #Here, the mac address looks like 00:00:00:00:00:00
      dstmac = str('\\x'+b.replace(':','\\x'))
      #Now, the mac address looks like this:
      "\x00\x00\x00\x00\x00\x00"
      sendp(dst=dstmac,blablablabla)
    ...
When this script send the mac on the wire, it send the actual \x (and all followed number)encoded in hex instead of sending 00 00 00 00 00 00.

Usually, you can use it this way and it's fine : "sendp(dst="\x00\x00\x00\x00\x00\x00",blablablabla)

I think i'm doing something wrong while doing this string manipulation, or encoding.

Any input on this will help !

Thanks !