How could I open a file via the function parameter in python?
<p>I'm trying to open a file via a function's parameter. The function I'm trying to make is going to be a multi-purpose one that will work with different files.</p>

<pre><code>def word_editor(open(filename, 'f'))
</code></pre>

<p>Would this be the correct way to open it? <code>filename</code> will represent whatever file I am opening. </p>