Python 2.5, Windows XP.
I am not a programmer by training/education, and fairly new to using Python but am getting things to work... This really has me stumped - I think obviously over my head. Please excuse my likely obvious lack of finesse with coding and Python. Thanks for any help in adavance.
I could use help with this within the next 24 hours.
I have an exe (.bat file, too -- not sure which would be best to use to make this work) which opens a gui where a user supplies a .txt file (containing numerous lines of <value> <frequency>). Also on the gui is a 'compute' button. Once this is clicked, several values are output onto text boxes on the gui. I am particularly interested in capturing one of these output values (EPC, at bottom of attached image). Also interested in sending the input .txt file to the exe (or should it be the bat file?), having the exe execute/compute automatically.
How should this be done?
So far, I have tried
The exe runs, but the .txt file is not put into the input box. Once I put it in, and I hit the 'compute' button, the exe runs and outputs the data, and I exit out of the tool, and I get this return
>>0
>>('', None)
This doesn't seem close. I have tried several similar code lines, but am just not getting anywhere. Help!
I am not a programmer by training/education, and fairly new to using Python but am getting things to work... This really has me stumped - I think obviously over my head. Please excuse my likely obvious lack of finesse with coding and Python. Thanks for any help in adavance.
I could use help with this within the next 24 hours.
I have an exe (.bat file, too -- not sure which would be best to use to make this work) which opens a gui where a user supplies a .txt file (containing numerous lines of <value> <frequency>). Also on the gui is a 'compute' button. Once this is clicked, several values are output onto text boxes on the gui. I am particularly interested in capturing one of these output values (EPC, at bottom of attached image). Also interested in sending the input .txt file to the exe (or should it be the bat file?), having the exe execute/compute automatically.
How should this be done?
So far, I have tried
Code:
import subprocess halls = subprocess.Popen([r'C:\Halls\hallbig2.exe'], stdin=subprocess.PIPE, stdout=subprocess.PIPE) result = halls.communicate(input=r'C:\Halls\Input\Ea39j.txt')[0] print halls.returncode print halls.communicate()
>>0
>>('', None)
This doesn't seem close. I have tried several similar code lines, but am just not getting anywhere. Help!
Comment