title: How to check whether a file is_open and the open_status in python
body: <p>Is there any python functions such as:</p>
  
  <pre><code>filename = "a.txt"
  if is_open(filename) and open_status(filename)=='w':
     print filename," is open for writing"
  </code></pre>