title: Python how to write to a binary file?
body: <p>I have a list of bytes as integers, which is something like</p>
  
  <pre><code>[120, 3, 255, 0, 100]
  </code></pre>
  
  <p>How can I write this list to a file as binary?</p>
  
  <p>Would this work?</p>
  
  <pre><code>newFileBytes = [123, 3, 255, 0, 100]
  # make file
  newFile = open("filename.txt", "wb")
  # write to file
  newFile.write(newFileBytes)
  </code></pre>