How to empty a file using Python
<p>In the Unix shell I can do this to empty a file:</p>

<pre><code>cd /the/file/directory/
:&gt; thefile.ext
</code></pre>

<p>How would I go about doing this in Python?</p>

<p>Is <code>os.system</code> the way here, I wouldn't know how since I would have to send 2 actions after each other i.e. the <code>cd</code> and then the <code>:&gt;</code>. </p>
