title: Send Hexadecimal string to socket using python
body: <p>Dear friends this is a humble request to solve my problem with example please.
  I am working on RFID sensors in which i need to send Hexadecimal data to socket. here is my code</p>
  
  <pre><code>import socket
  
  HOST = '192.168.0.115' 
  PORT = 20108
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  s.connect((HOST, PORT))
  DATA = 'A5 5A 00 08 04 0C 0D 0A'
  s.send(DATA)
  data = s.recv(4096)
  s.close()
  d = data.encode('hex').upper()
  print 'Received', repr(d)
  </code></pre>
  
  <p>this code is sending DATA in string format but i need to send the DATA in Hexadecimal format because the RFID reader can read Hexadecimal data... i already use struct.pack but it is not working for me or may be I don't know how to use it...
  the DATA is same <code>"A5 5A 00 08 04 0C 0D 0A"</code> this but how do i send this in Hexadecimal format... for example if sock.send("") sending string. in need to send socket.send(hexadecimal)???</p>