このコードを使用してサブプロセスを実行し、コマンド ウィンドウに whats の出力を出力する必要があります。
import subprocess
msprompt = 'C:\Windows\Microsoft.NET\Framework64\\v4.0.30319\\MSBuild.exe'
path = "C:/Users/bgb/Documents/Brent/Code/Visual Studio/tree.DataManagement.UnitTests./tree.DataManagement.UnitTests.vbproj"
def command(msprompt, openFile):
for line in finalPathList:
p = subprocess.Popen([msprompt, path], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
for line in p.stdout.readlines():
print line,
retval = p.wait()
これをコンパイラで実行すると、機能しません。次のメッセージが表示されます。
MSBUILD : error MSB1009: Project file does not exist.
Switch: "C:/Users/bgb/Documents/Brent/Code/Visual Studio/tree.FormControls.UnitTests./tree.FormControls.UnitTests.vbproj"
ただし、コマンドウィンドウを完全に個別に開き、msprompt
コピーして貼り付けてから、コマンドウィンドウにコピーして貼り付けてEnterキーを押すと、完全に機能します。関数path
で何を台無しにしているか知っている人はいますかcommand
??
助けていただければ幸いです。