title: Sending buffer to HID with python
body: <p>I want to send a buffer to an HID, I have trouble making the buffer, here's my code:</p>
  
  <pre><code>buffer = [0x00]*20
  print(buffer)
  buffer[0:10] = {0x00,0x00,0x11,0x06,0x00,0x04,0x1A,0x00,0x00,0x0b,0xb8}
  print(buffer)
  </code></pre>
  
  <p>the output is:</p>
  
  <pre><code>[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  [0, 4, 6, 11, 17, 184, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  </code></pre>
  
  <p>but when I use this:</p>
  
  <pre><code>buffer[0] = 0x00
  buffer[1] = 0x00
  buffer[2] = 0x11
  buffer[3] = 0x06
  buffer[4] = 0x00
  buffer[5] = 0x04
  buffer[6] = 0x1A
  buffer[7] = 0x00
  buffer[8] = 0x00
  buffer[9] = 0x0b
  buffer[10] = 0xb8
  </code></pre>
  
  <p>The output is:
      [0, 0, 17, 6, 0, 4, 26, 0, 0, 11, 184, 0, 0, 0, 0, 0, 0, 0, 0, 0]</p>
  
  <p>I also should convert from decimal to hex, for example 1000 to hex.</p>
  
  <pre><code>print(hex(1000))
  </code></pre>
  
  <p>It gives:</p>
  
  <pre><code>0x3e8
  </code></pre>
  
  <p>I want to have :</p>
  
  <pre><code>03 E8
  </code></pre>
  
  <p>How can I have it?</p>