How to get an absolute file path in Python
<p>Given a path such as <code>"mydir/myfile.txt"</code>, how do I find the absolute filepath relative to the current working directory in Python? E.g. on Windows, I might end up with:</p>

<pre><code>"C:/example/cwd/mydir/myfile.txt"
</code></pre>

<pre><code>&gt;&gt;&gt; import os
&gt;&gt;&gt; os.path.abspath("mydir/myfile.txt")
</code></pre>
