title: Run windows executable from python script with multiple arguments
body: <p>I am working on a program that will find some files and provide the file information to a NSIS script.  The NSIS script accepts the command line as follows</p>
  
  <pre><code>makensis.exe /DON="This is one" /DOD="c:\path1\path2 to dir\path 3" scriptfile.nsi
  </code></pre>
  
  <p>The values of the switches will change on each execution of the program.  I have tried to get this to execute using subprocess.call and subprocess.Popen.  The issue I am having has to do with quoting.  </p>
  
  <p>First of all the subprocess calls seem to put the entire argument statement between double quotes making NSIS see them as one argument.  Second I am having some difficulty getting the individual  switches properly quoted on the command line.  Here is a snippet of what my program currently looks like.</p>
  
  <pre><code>subprocess.Popen([setup.profile['NSISExe'], ' /DON="' + setup.profile['DESC'] + '" /DOD="' + setup.profile['InstallDir'] + \
     '" /DMT="' + app.machine_type.get() + '" /DSD="' + os.path.join(WinShellVar.LOCAL_APPDATA, 'MLC CAD', appname) + \
     '" /DXV=X6 ' + setup.profile['NSISScript']])
  </code></pre>
  
  <p>And here is the output from NSIS</p>
  
  <pre><code>    Can't open script " /DON="Mastercam X6 Standard" /DOD="C:\Users\John\Desktop" /D
  MT="mill" /DSD="C:\Users\John\AppData\Local\MLC CAD\mcdeftool" /DXV=X6 bin\packa
  ge.002.nsi"
  </code></pre>
  
  <p>As you can see I am using a mixed bag of data, getting some bits for dicts and some from class calls <em>(be easy on me if my terms are somewhat incorrect, I have been learning python for about 4 days now, correct me please just nicely).</em>  If using this data like this is "unpythonic" let me know.</p>
  
  <p>Looking forward to your input</p>