How to execute a file that requires being in the same directory?
<p>I have a python script that needs to execute a <code>.jar</code> file that is located in another directory. What would be the best way to do this? So far I was thinking -</p>

<pre><code>subprocess.call(["cd","/path/to/file"])
subprocess.call(["./file.jar"])
</code></pre>

<p>How should I do this?</p>

<p><strong>Update:</strong></p>

<p>Using both of the answers below, this is what I ended up doing:</p>

<pre><code>subprocess.call(shlex.split("./file.jar -rest -of -command"), cwd=COMMAND_FOLDER)
</code></pre>
