I&#39;m working on a Windows machine and want to use subprocess to run several commands from the command line.  <div><br></div><div>Normally with bat files or some of the other scripting languages on Windows, I would set up a variable with the path to the command like so:</div>
<div><br></div><div>gpg = &#39;c:/program files (x86)/gnu/gnupg/gpg2.exe&#39;</div><div><br></div><div>Then call the command the variable to avoid typing in the full path.</div><div><br></div><div>When I do this with subprocess it works:</div>
<div><br></div><div>subprocess.Popen(&#39;c:/program files (x86)/gnu/gnupg/gpg2.exe&#39;, shell=True)</div><div><br></div><div>However when I do this:</div><div><br></div><div>gpg = &#39;c:/program files (x86)/gnu/gnupg/gpg2.exe&#39;</div>
<div><br></div><div>subprocess.Popen(&#39;gpg&#39;, shell=True)</div><div><br></div><div>It fails to run gpg and is not expanding the variable.  Is there a way to do this that I&#39;m missing?<br><br>Becky </div>