我正在尝试从Python脚本运行.exe文件,.exe文件会打开命令窗口,并要求输入文件名。因此,我想知道如何运行此.exe文件并将带有输入文件名的字符串发送到程序。
目前,我有这个:
<ul>
输出是这样的:
#bolsig is the path to the .exe file
p = Popen(bolsig, stdin=PIPE)
p.communicate(input=b'he_test.dat')
但是输出应该是:
BOLSIG+ script file?
forrtl: The pipe has been ended.
forrtl: severe (24): end-of-file during read, unit -4, file CONIN$
Image PC Routine Line Source
bolsigminus.exe 00FD8A8A Unknown Unknown Unknown
bolsigminus.exe 00FC09D4 Unknown Unknown Unknown
bolsigminus.exe 012A1272 Unknown Unknown Unknown
bolsigminus.exe 01033CD5 Unknown Unknown Unknown
KERNEL32.DLL 74128484 Unknown Unknown Unknown
ntdll.dll 7730302C Unknown Unknown Unknown
ntdll.dll 77302FFA Unknown Unknown Unknown