2012-09-10 45 views
0

我正在寫一個共享庫,並且爲了在我/usr/include目錄更新的頭文件,我寫了一個Python程序進行比較,並從保持頭文件源目錄最新的/usr/include目錄中,希望能有頭內自動完成自己在每次構建時,我與我的測試可執行鏈接它們。Qt Creator的拒不執行自定義Python程序作爲構建步驟的命令

的問題是,Qt Creator的未能執行的Python程序。我的設置如下:

Command : 'python' 
Working Directory : '/path/to/python/file' 
Args : 'PythonFile.py' 

是的,啓用自定義工序複選框被選中。

我看到以下的輸出:

Could not start process "python " PythonFile.py

當然,如果有另一種方式來解決這個標題問題,這是更爲簡單(包括自動完成的功能進行更新),我完全都是耳朵。

編輯

我還要說我執行通過CLI程序,它工作正常。

更新

每更新根據光榮的建議的命令,我得到了以下的輸出:

Program is beginning 
Traceback (most recent call last): 
    File "UpdateHeaders.py", line 59, in <module> 
    PROJECT_ROOT  = environ['ATLAS_PROJ_ROOT'] 
    File "/usr/lib/python2.7/UserDict.py", line 23, in __getitem__ 
    raise KeyError(key) 
KeyError: 'ATLAS_PROJ_ROOT' 
13:08:35: The process "/usr/bin/env" exited with code 1. 

然而,如果我通過CLI運行它,我得到這個:

Program is beginning 
Updating include directory on a UNIX based system, copying files from /home/amsterdam/Programming/atlas/Engine/AtlasEngine/ to /usr/include/atlas/Engine/ 
Found a source count of 5; 
Found a dest count of 0 
No headers have been copied to "/usr/include/atlas/Engine/", yet; copying now from "/home/amsterdam/Programming/atlas/Engine/AtlasEngine/" 
Iterating through ['AtlasEngine.pro', 'GameObject.hpp', 'AtlasEngine_global.h', 'Type_Config.hpp', 'Rectangle.hpp', 'AtlasEngine.pro.user', 'Engine.hpp', 'Engine.cpp'] 
Copying "/home/amsterdam/Programming/atlas/Engine/AtlasEngine/GameObject.hpp" to "/usr/include/atlas/Engine/GameObject.hpp" 
Copying "/home/amsterdam/Programming/atlas/Engine/AtlasEngine/AtlasEngine_global.h" to "/usr/include/atlas/Engine/AtlasEngine_global.h" 
Copying "/home/amsterdam/Programming/atlas/Engine/AtlasEngine/Type_Config.hpp" to "/usr/include/atlas/Engine/Type_Config.hpp" 
Copying "/home/amsterdam/Programming/atlas/Engine/AtlasEngine/Rectangle.hpp" to "/usr/include/atlas/Engine/Rectangle.hpp" 
Copying "/home/amsterdam/Programming/atlas/Engine/AtlasEngine/Engine.hpp" to "/usr/include/atlas/Engine/Engine.hpp" 

如圖所示,除非它通過Qt Creator的運行一切正常,沒有任何錯誤。有什麼建議麼?

+0

當你改變命令 「的/ usr/bin中/ Python的」 會發生什麼? – stark

+0

同樣的錯誤,但它打印'在/ usr/bin'字符串的一部分。 – zeboidlund

回答

1

Command : '/usr/bin/env'
Working Directory : '/path/to/python/file'
Args : 'python PythonFile.py'


Command : '/usr/bin/env'
Args : 'python /path/to/python/file/PythonFile.py'

+0

在這裏,看看我的更新。這絕對是向前邁出的一步,但該計劃將無法正確執行。任何想法爲什麼? – zeboidlund

+0

大概是因爲錯誤的工作目錄,並腳本靠什麼呢?插入'os.getcwd()'並比較它們。 –

相關問題