<pre><codeclass="python language-python hljs"><str> = os.getcwd() <spanclass="hljs-comment"># Returns the current working directory.</span>
<str> = path.join(<path>, ...)<spanclass="hljs-comment"># Joins two or more pathname components.</span>
<str> = path.realpath(<path>)<spanclass="hljs-comment"># Resolves symlinks and calls path.abspath().</span>
<str> = os.path.join(<path>, ...) <spanclass="hljs-comment"># Joins two or more pathname components.</span>
<str> = os.path.realpath(<path>) <spanclass="hljs-comment"># Resolves symlinks and calls path.abspath().</span>
</code></pre>
<pre><codeclass="python language-python hljs"><str> = path.basename(<path>)<spanclass="hljs-comment"># Returns final component of the path.</span>
<str> = path.dirname(<path>)<spanclass="hljs-comment"># Returns path without the final component.</span>
<tup.> = path.splitext(<path>)<spanclass="hljs-comment"># Splits on last period of the final component.</span>
<pre><codeclass="python language-python hljs"><str> = os.path.basename(<path>) <spanclass="hljs-comment"># Returns final component of the path.</span>
<str> = os.path.dirname(<path>) <spanclass="hljs-comment"># Returns path without the final component.</span>
<tup.> = os.path.splitext(<path>) <spanclass="hljs-comment"># Splits on last period of the final component.</span>
</code></pre>
<pre><codeclass="python language-python hljs"><list> = os.listdir(path=<spanclass="hljs-string">'.'</span>) <spanclass="hljs-comment"># Returns filenames located at the path.</span>
<list> = glob.glob(<spanclass="hljs-string">'<pattern>'</span>) <spanclass="hljs-comment"># Returns paths matching the wildcard pattern.</span>