title: os.system commands
body: <p>I am developing a program which needs to use os.system because of the old Python limitations. Currently I'm stuck in one small spot. </p>
  
  <pre><code>os.system("C:\\FIOCheck\\xutil.exe  -i get phy" +HBEA + "&gt;C:\\FIOCheck\\HBEAResult.txt")
  </code></pre>
  
  <p>This is the piece of code I am trying to work through. It will access an external program, which has some parameters. HBEA is the variable I am trying to pass (which is received earlier in the program). The program then takes whatever the .exe created and pipes it to an external file. At this point, the variable HBEA is not being passed to the command line, so the .exe never runs, which causes the .txt to be blank. Since the file is blank, I cannot grab data from it and therefore cannot complete the program.</p>
  
  <p>Any ideas?</p>
  
  <p>EDIT:
  So I attempted the following code per some suggestions:</p>
  
  <pre><code>cmd = "C:\\FIOCheck\\xutil.exe  -i get phy " +HBEA + "&gt;C:\\FIOCheck\\HBEAResult.txt"
  print cmd
  os.system(cmd)
  </code></pre>
  
  <p>The following output was generated:</p>
  
  <pre><code>50012BE00004BDFF  #HBEA variable
  C:\FIOCheck\xutil.exe  -i get phy 50012BE00004BDFF&gt;C:\FIOCheck\HBEAResult.txt #the cmd  var
  </code></pre>
  
  <p>However this still isn't passing the value through. <strike>Is the HBEA variable too long?</strike></p>
  
  <p><b> SOLVED </b></p>
  
  <p>This program worked with some editing from the best answer. The commands were passing correctly, however the way I formatted it was not correct. The new formatting looks like:</p>
  
  <pre><code>cmd = "C:\\FIOCheck\\xutil.exe -i " + HBEA + " get ver" + "&gt;C:\\FIOCheck\\HBEAResult.txt"
  os.system(cmd)
  </code></pre>
  
  <p>Thanks for the help!</p>