Launch Python script in new terminal
<p>I want to launch a python script in a new macOS terminal window from another script. I'm currently using this code:</p>

<pre><code>subprocess.call(['open', '-a', 'Terminal.app', '/usr/bin/python'])
</code></pre>

<p>which launches a python prompt in a new terminal window.
But when I try to run a python script with this code:</p>

<pre><code>subprocess.call(['open', '-a', 'Terminal.app', '/usr/bin/python', 'test.py'])
</code></pre>

<p>it completely ignores the <code>'test.py'</code> on the end and starts a python prompt, just like it does without the test.py on the end.</p>

<p>How can I make this work?</p>

<p>Don't use the <code>open -a terminal.app</code>, just use the python executable</p>

<pre><code>subprocess.call(['/usr/bin/python', 'test.py'])
</code></pre>

python osx python-2.7 subprocess terminal.app