在原子中编译python

时间:2017-04-04 06:58:09

标签: python atom-editor

我使用atom来编译我的python代码。我想测试我的IDE。但我遇到了这个问题。这是错误:

CharacterCounter count_string_chars( const std::string& line )
{
    CharacterCounter counter;
    for( std::size_t i = 0; i < line.size(); ++i )
    {
        counter.count( line.at(i) );
    }
    return counter;
}

最后,原子说:

Uncaught TypeError: Bad argument
internal/child_process.js:289
TypeError: Bad argument
at TypeError (native)
at ChildProcess.spawn (internal/child_process.js:289:26)
at Object.exports.spawn (child_process.js:392:9)
at compile (C:\Users\wenzh\.atom\packages\gpp-compiler\index.js:274:31)
at compileFile (C:\Users\wenzh\.atom\packages\gpp-compiler\index.js:216:5)
at atom-text-editor.gpp-compiler:compile (C:\Users\wenzh\.atom\packages\gpp-compiler\index.js:23:11)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\wenzh\AppData\Local\atom\app-1.15.0\resources\app.asar\src\command-registry.js:259:29)
at C:\Users\wenzh\AppData\Local\atom\app-1.15.0\resources\app.asar\src\command-registry.js:3:59
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (C:\Users\wenzh\AppData\Local\atom\app-1.15.0\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:599:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (C:\Users\wenzh\AppData\Local\atom\app-1.15.0\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:390:22)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (C:\Users\wenzh\AppData\Local\atom\app-1.15.0\resources\app.asar\src\window-event-handler.js:106:36)

我该如何解决?谢谢!

1 个答案:

答案 0 :(得分:0)

我刚刚解决了这个问题。您可以转到“文件” - >“按键映射...”,然后打开文件“keymap.cson”。你可以在下面添加到底部。这意味着F7用于gpp编译器,F5用于python运行:

'.editor:not(.mini)':
    "f7": "gpp-compiler:compile"
    "f5": "Python run: run-f5"