title: How to pass argparse arguments to another python program?
body: <p>I am tying a script which will pass argparse arguments to another python</p>
  
  <p>1st script : <strong>t.py</strong></p>
  
  <pre><code>import argparse
  import subprocess
  import os
  
  commandLineArgumentParser = argparse.ArgumentParser()
  commandLineArgumentParser.add_argument("-fname", "--fname",  help="first name")
  commandLineArgumentParser.add_argument("-lname","--lname", help="last name")
  commandLineArguments = commandLineArgumentParser.parse_args()
  
  fname = commandLineArguments.fname
  lname = commandLineArguments.lname
  
  print "%s\n%s" %(fname,lname)
  
  os.system("python test1.py")
  </code></pre>
  
  <p>code for test1.py is bellow</p>
  
  <pre><code>import argparse
  import os
  
  print "test abc"
  </code></pre>
  
  <p>I want to pass <strong>lname</strong> and <strong>fname</strong> values to <strong>test1.py</strong> .is their their any way to do that.</p>
  
  <p>in the above code if I ran </p>
  
  <pre><code>python t.py -fname ms lname = dhoni
  </code></pre>
  
  <p>then the output is </p>
  
  <pre><code>ms
  dhoni
  test abc
  </code></pre>
  
  <p>But I want the output to be like bellow</p>
  
  <pre><code>ms
  dhoni
  ms
  dhoni 
  </code></pre>