Python Flushing and Already Closed File
<p>How do I add a check to avoid flushing a file f with f.flush() when some function has already done f.close()?</p>

<p>I can't seem to figure out how to do so :/</p>
