title: Storing the Output while Executing ".exe" file using python is not as expected
body: <p>I have an executable file where i need to pass the input and get the output details. However Output can be saved in 3 formats "HTML","XML","Text" format. But by default it will save in HTML if user doesn't opt for any specific format.</p>
  
  <p>I have my script which can do what i have mentioned above. But output is saving in ".HTML" . Is there any way to select the desired output options.</p>
  
  <p>I used subprocess  for interacting with exe file.</p>
  
  <pre><code>cmd = (r'C:\Program Files\file.exe',k1)
  proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
  out = proc.communicate()
  print out[0]
  s= str(out[0])
  print type(s)    
  f2 = open(k1+'.xml','wb') #storing in html (as its taking it by default)
  f2.write(s)
  f2.close()
  </code></pre>