title: How to execute one python file with the arguments from another python file without passing arguments on command/terminal line?
body: <p>I have a default code in Python that has the argument parser and have to pass those argument by myself in command line,but i dont want to pass the arguments myself rather execute that file from another python file with the arguments written in that file or i dont want to write those arguments myself on command lines.</p>
  
  <p>My argument parsing code is as follows:</p>
  
  <pre><code>if __name__ == "__main__":
       parser = argparse.ArgumentParser()
       parser.add_argument('-i', type=str, nargs='+', help="Enter the filenames with extention of an Image")
       arg=parser.parse_args()
  
      if not len(sys.argv) &gt; 1:
      parser.print_help()
      exit()
  </code></pre>
  
  <p>my function is </p>
  
  <pre><code>def Predict_Emotion(filename):
        print "Opening image...."
        try:
            img=io.imread(filename)
            cvimg=cv2.imread(filename)
       except:
             print "Exception: File Not found."
             return
  </code></pre>
  
  <p>And my execution line is as</p>
  
  <pre><code>for filename in arg.i:
       Predict_Emotion(filename)
  </code></pre>
  
  <p>Any help would be appreciated.</p>