title: Python : How to pass file object as function parameter on python script?
body: <p>I edited python script like below.</p>
  
  <pre><code>def func(file_obj)
      str="test"
      file_obj.write(str)
  
  def main():
      f=open("test.txt", 'w')
      func(f)
      f.close()
  
  if __name__=='__main__':
      main()
  </code></pre>
  
  <p>And then error happened like below.</p>
  
  <pre><code>File "test.py", line 2
  def func(file_obj)
                   ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>How to pass file object as function parameter?</p>