title: Pass a variable to a path/command in python
body: <p>I am new to Python. I want to execute a script which has parameters in python. Please have a look at below example on what I finally want to achieve.</p>
  
  <p>I have a script with parameters:</p>
  
  <pre><code>PATH="ABCXYZ"
  username = "admin"
  password = "pass"
  query = "select * from user;"
  OUTPUT = /usr/local/&lt;PATH&gt;/dbscript -u username -p password -q query
  </code></pre>
  
  <p>How can I pass a <code>PATH</code> variable in "/usr/local/&lt;<strong>PATH</strong>>/dbscript" here ?</p>
  
  <p>I tried with <code>os.system</code> &amp; <code>subprocess</code>, But We cannot use variable in between.
  I want that <code>OUTPUT</code> variable data which will print <code>yes</code> or <code>no</code> or <code>some number</code></p>