title: I was programming in python and I am stuck with making a binary file
body: <p>So I want to make a binary file in Python but it gives a error</p>
  <blockquote>
  <p>TypeError: a bytes-like object is required, not 'str'
  Here is my code</p>
  </blockquote>
  <pre><code>with open('test.binary','wb') as f:
      f = f.write('Hello!')
  </code></pre>
  <p>Can anyone please help?</p>