title: Execute python file from another python file by passing argument as variable
body: <p>In the below code, I am trying to take the path name (inclusive of file name) and converting them to another path name with text file.</p>
  
  <p>Now I would like to pass both variable as argument for another py which will take it as argument</p>
  
  <pre><code>import os
  
  thisdir=[os.path.join(r,file) for r,d,f in 
  os.walk("C:\\Users\\vnitin\\OneDrive - NetApp Inc\\IDP\\Files\\") for file 
  in f]
  for i in range(len(thisdir)):
      text_path = thisdir[i].replace('pdf', 'txt')
      print(text_path)
      os.system('py pdf2txt.py -o text_path thisdir[i]')
  </code></pre>
  
  <p>But individual command for pdf2txt.py works very well.</p>
  
  <pre><code>py .\pdf2txt.py -o 'C:\Users\vnitin\OneDrive - NetApp Inc\IDP\Files\11.txt'  
  'C:\Users\vnitin\OneDrive - NetApp Inc\IDP\Files\11.pdf'
  </code></pre>