title: Passing byte string from Python to C
body: <p>I am writing a python extension in C and I am trying to pass a bytes object to my function.  Obviously the 's' token is for strings; I have tried 'O', 'N', and a few others with no luck. Is there a token I can use to parse a bytes object? If not is there an alternative method to parse bytes objects?</p>
  <pre><code>static PyObject *test(PyObject *self, PyObject *args)
  {
      char *dev;
      uint8_t *key;
  
      if(!PyArg_ParseTuple(args, &quot;ss&quot;, &amp;dev, &amp;key))
          return NULL;
  
      printf(&quot;%s\n&quot;, dev);
  
      for (int i = 0; i &lt; 32; i++)
      {
            printf(&quot;Val %d: %d\n&quot;, i, key[i]);
      }
  
      Py_RETURN_NONE;
  }
  </code></pre>
  <p>Calling from python: <code>test(b&quot;device&quot;, f.read(32))</code>.</p>