title: create file of particular size in python
body: <p>I want to create a file of particular size (say, 1GiB).
  The content is not important since I will fill stuff into it.</p>
  
  <p>What I am doing is:</p>
  
  <pre><code>f = open("E:\\sample", "wb")
  size = 1073741824 # bytes in 1 GiB
  f.write("\0" * size)
  </code></pre>
  
  <p>But this takes too long to finish. It spends me roughly 1 minute.
  What can be done to improve this?</p>