0

我正在编写一个共享库,为了更新我的/usr/include目录中的头文件,我编写了一个 python 程序来比较源目录中的头文件并使目录中的头文件保持最新/usr/include,希望能够在目录中自动完成当我将它们与我的测试可执行文件链接时,每个构建的标题本身。

问题是 Qt Creator 无法执行 python 程序。我的设置如下:

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

是的,启用自定义流程步骤框已选中。

我的输出类似于以下内容:

Could not start process "python " PythonFile.py

诚然,如果有另一种更简单的方法来解决这个标题问题(并且包括更新自动完成的能力),我完全可以接受。

编辑

我还应该说我已经通过 CLI 执行了该程序,并且运行良好。

更新

根据 Slava 的建议更新命令,我得到以下输出:

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 运行,否则一切正常,没有任何错误。有什么建议么?

4

1 回答 1

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'

于 2012-09-10T08:36:01.687 回答