title: Incorrect size of file in python
body: <pre><code>import os
  
  def create_python_script(filename):
      comments = "# Start of a new Python Program"
      #filesize = 0
      with open(filename, 'w') as new_file:
          new_file.write(comments)
          cwd=os.getcwd()
          fpath = os.path.abspath(filename)
          filesize=os.path.getsize(fpath)
      return(filesize)
  
  print(create_python_script('newprogram.py'))
  </code></pre>
  
  <p>I am getting result as zero  but it should get "31"</p>