title: Output number from c++ as bytes and read it in python
body: <p>Lets say I have some integer in c++ code. I want to send this integer to python as bytes. The next code:</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;sstream&gt;
  
  int main() {
      std::stringstream output;
      uint32_t schemaHash = 3049619955;
      output.write(reinterpret_cast&lt;const char*&gt;(&amp;schemaHash), sizeof(schemaHash));
      std::cout &lt;&lt; output.str() &lt;&lt; &quot;\n&quot;;
      return 0;
  }
  </code></pre>
  <p>outputs єБ┼╡.</p>
  <p>Then I copy these bytes and try to parse them in the following way:</p>
  <pre><code>import struct
  
  data = input().encode()
  print(struct.unpack_from(&quot;=I&quot;, data))
  </code></pre>
  <p>This code outputs (2446365905,).</p>
  <p>The question is how to fix this. I cannot understand what I am doing wrong and how to interpret c++ integer as bytes in python.</p>