title: Writing files in Python and carriage return in Windows
body: <p>I'm using OpenCV Python library to extract descriptors and write them to file. Each descriptor is <strong>32</strong> bytes and I only save <strong>80</strong> of them. Meaning that, the final file must be exactly <strong>2560</strong> bytes. But it's <strong>2571</strong> bytes. </p>
  
  <p>I also have another file which had been written using the same Python script (Not on Windows but I guess it was on Linux) and it's exactly <strong>2560</strong> bytes.</p>
  
  <p>Using WinMerge, I tried to compare them and it gave me a warning that the carriage return is different in two files and asked me if I wanted to treat them equally. If I say "yes", then both files are identical but if I say "no" then they are different.</p>
  
  <p>I was wondering if there is anyway in Python to write binary files which produce identical result on both Windows and Linux?</p>
  
  <p>Not to mention this is the relevant part of the script:</p>
  
  <pre><code>f = open("something", "w+")
  f.write(descriptors)
  f.close() 
  </code></pre>