/usr/bin/python: can't find '__main__.py' in '/' when using subprocess.call
<p>I am writing a Python script to do some admin functionality which involves running several other python scripts.</p>

<p>A snipet of my code looks like this:</p>

<pre><code>import subprocess

PYTHON_BIN_DIR = '/usr/bin/python'
SCRIPTS_DIR = '/some/path'


if __name__ == "__main__":
    dateparam = "05-Jan-2012"
    command = [PYTHON_BIN_DIR]
    command.extend(SCRIPTS_DIR + "/myfile1.py")
    strparams = " --param1={0} ".format(123)
    command.extend(strparams)
    command.extend(dateparam)

    retcode = subprocess.call(command)

    if retcode != 0:
        # do something
        pass
    else:
        # do something else
        pass
</code></pre>

<p>All the scripts I'm calling are using the <code>if __name__ == ""__main__""</code> check/test. So what's causing the error?</p>
