title: String to hex value of FF in python 2.7
body: <p>I know this is a basic question, but I am really struggling to work it out.</p>
  
  <p>I am trying to get a string to convert to FF in hex (i.e. OxFF) in python 2.7.</p>
  
  <p>I convert the string to bytearray then to hex using the following code: </p>
  
  <pre><code>&gt;&gt;&gt; data = 'OxFF'
  &gt;&gt;&gt; array = bytearray(data)
  &gt;&gt;&gt; print binascii.hexlify(array)
  4f784646
  </code></pre>
  
  <p>For context, I am sending a message over TCP/IP using twisted and the header needs to be FF FF</p>
  
  <p>Any help would be amazing.</p>
  
  <p>Cheers</p>