scons を使用してビルドし.exe
、64 ビットか 32 ビットかを確認する python プログラムを作成しています。を試しplatform.architecture(test1.exe)
ましたが、問題は 32 ビットの exe を指定すると、64 ビットだと表示されることです。
使ってみdumpbin
ましたが出力が大きいのでこちらを使用しましdumpin /HEADERS test.exe |find "machine"
た。問題は、python を使用してこのコマンドを実行できないことです。を使用するsubprocess.call(['dumpbin /HEADERS test2.exe |find "machine"'])
と、次のエラーが表示されます
Traceback (most recent call last):
File "test_scons.py", line 66, in <module>
print "Architecture of the compiled program is ",subprocess.call(["dumpbin /HEADERS test2.exe |find ""machine" ])
File "C:\Python27\lib\subprocess.py", line 493, in call
return Popen(*popenargs, **kwargs).wait()
File "C:\Python27\lib\subprocess.py", line 679, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 896, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified