visual-studio-code - 在VSCode中直接执行Python代码的问题

 影子张被占用 发布于 2022-10-30 15:24

http://stackoverflow.com/q/29987840/5295549
我参照stackoverflow上的一个answer那么做了,可是出现以下错误:

Failed to launch external program C:\Python35 
app.py. 
spawn C:\Python35 ENOENT 

请问是什么问题呢?

这是我的配置【只修改了下command路径】

{
    "version": "0.1.0",
    "command": "C:\\Python35",
    "args": ["app.py"],
    "problemMatcher": {
        "fileLocation": ["relative", "${workspaceRoot}"],
        "pattern": {
            "regexp": "^(.*)+s$",
            "message": 1
        }
    }
}
2 个回答
  • {
        "version": "0.1.0",
    
        // The command is tsc. Assumes that tsc has been installed using npm install -g typescript
        "command": "C:\\Python35\\python",
    
        // The command is a shell script
        "isShellCommand": true,
    
        // Show the output window only if unrecognized errors occur.
        "showOutput": "always",
    
        // args is the HelloWorld program to compile.
        "args": ["${file}"],
    
        // use the standard tsc problem matcher to find compile problems
        // in the output.
        //"problemMatcher": "$tsc"
    }
    

    将配置做以上修改即可。

    2022-10-31 21:49 回答
  • 就在这个SO下面有另一个回答,前段时间正好简单翻译了下。
    看这里

    2022-10-31 21:49 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有