<h1id="-Python-Path-and-Subprocess-(useful-for-scripting)-"><center> Python Path and Subprocess (useful for scripting) </center><aclass="anchor-link"href="#-Python-Path-and-Subprocess-(useful-for-scripting)-">¶</a></h1>
<h2id="How-to-list-all-files-in-a-directory">How to list all files in a directory<aclass="anchor-link"href="#How-to-list-all-files-in-a-directory">¶</a></h2><divclass="highlight"><pre><span></span><spanclass="kn">import</span><spanclass="nn">os</span>
<h2id="list-only-files-of-a-given-extension">list only files of a given extension<aclass="anchor-link"href="#list-only-files-of-a-given-extension">¶</a></h2><divclass="highlight"><pre><span></span><spanclass="kn">import</span><spanclass="nn">os</span>
<h2id="construct-filenames-with-other-files-and-a-different-path">construct filenames with other files and a different path<aclass="anchor-link"href="#construct-filenames-with-other-files-and-a-different-path">¶</a></h2><divclass="highlight"><pre><span></span><spanclass="kn">import</span><spanclass="nn">os</span>
<h2id="execute-other-programs:-Subprocess-module">execute other programs: Subprocess module<aclass="anchor-link"href="#execute-other-programs:-Subprocess-module">¶</a></h2><divclass="highlight"><pre><span></span><spanclass="kn">import</span><spanclass="nn">subprocess</span>
<h2id="Saving-output-into-a-file">Saving output into a file<aclass="anchor-link"href="#Saving-output-into-a-file">¶</a></h2><divclass="highlight"><pre><span></span><spanclass="kn">import</span><spanclass="nn">subprocess</span>
<h2id="Saving-output-into-a-string">Saving output into a string<aclass="anchor-link"href="#Saving-output-into-a-string">¶</a></h2><divclass="highlight"><pre><span></span><spanclass="kn">import</span><spanclass="nn">subprocess</span>