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.
os.system("C:\\FIOCheck\\xutil.exe -i get phy" +HBEA + ">C:\\FIOCheck\\HBEAResult.txt")
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.
Any ideas?
EDIT: So I attempted the following code per some suggestions:
cmd = "C:\\FIOCheck\\xutil.exe -i get phy " +HBEA + ">C:\\FIOCheck\\HBEAResult.txt"
print cmd
os.system(cmd)
The following output was generated:
50012BE00004BDFF #HBEA variable
C:\FIOCheck\xutil.exe -i get phy 50012BE00004BDFF>C:\FIOCheck\HBEAResult.txt #the cmd var
However this still isn't passing the value through. Is the HBEA variable too long?
SOLVED
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:
cmd = "C:\\FIOCheck\\xutil.exe -i " + HBEA + " get ver" + ">C:\\FIOCheck\\HBEAResult.txt"
os.system(cmd)
Thanks for the help!