開發了一個使用msbuild構建項目的腳本。我有使用wxpython開發的圖形用戶界面,它有一個按鈕,當用戶點擊時可以使用msbuild建立一個項目。現在,當用戶單擊該按鈕時,我想打開一個狀態窗口,並顯示在命令提示符下顯示的所有輸出,並且不應顯示命令提示符,即將命令提示符輸出重定向到用戶GUI狀態窗口。我的構建腳本是,重定向命令提示符輸出到python生成的窗口
def build(self,projpath)
arg1 = '/t:Rebuild'
arg2 = '/p:Configuration=Release'
arg3 = '/p:Platform=x86'
p = subprocess.call([self.msbuild,projpath,arg1,arg2,arg3])
if p==1:
return False
return True
Thank [email protected]爲我工作。 – Aramanethota 2013-03-22 04:49:36