Call a python main from another python script
<p>I have been giving some huge command line tool from a colleague. The main reads a bunch of arguments, parses those using the elegant <code>import OptionParser</code> later on and does the job.</p>

<pre><code>if __name__ == '__main__':
    main(sys.argv)
</code></pre>

<p>I can either dig into the code and copy paste loads of code, or find a way to use a "command line" call from my python script. I guess the second option is preferrable as it prevents me from randomly extracting code. Would you agree ? </p>
