开先建设集团网站,西宁网站建设公司排名,济南网app,黄页88推广多少钱vscode-python环境配置
1、环境基础
下载vscode找到python插件并安装安装python环境并配置环境变量
2、选择python解释器
尝试执行了一下#xff0c;直接运行py文件#xff0c;会使用c的调试工具#xff0c;需要告诉vscode哪些是python Ctrl Shift P打开命令面板 执行…vscode-python环境配置
1、环境基础
下载vscode找到python插件并安装安装python环境并配置环境变量
2、选择python解释器
尝试执行了一下直接运行py文件会使用c的调试工具需要告诉vscode哪些是python Ctrl Shift P打开命令面板 执行python: Select Interpreter选择对应的python.exe。vscode会将这个python.exe的路径存储在工作区设置里
3、codeRunner
第二步似乎作用不大理论上已经可以直接执行了但是没有
于是在扩展工具里装了一个CodeRunner进入python文件右上角run code
执行成功
应该可以不使用CodeRunner执行我有点嫌弃这个需要点击的编译方式
4、配置文件 launch.json { version: 0.2.0, configurations: [ {name: Python: Current File,type: python,request: launch,program: ${file},python: D:\\Setting\\Python\\python.exe,args: [--source]},{ name: (gdb) Launch, // 配置名称将会在启动配置的下拉菜单中显示 type: cppdbg, // 配置类型这里只能为cppdbg request: launch, // 请求配置类型可以为launch启动或attach附加 program: ${workspaceFolder}/exe/${fileBasenameNoExtension}.exe,// 将要进行调试的程序的路径 args: [], // 程序调试时传递给程序的命令行参数一般设为空即可 stopAtEntry: false, // 设为true时程序将暂停在程序入口处一般设置为false cwd: ${workspaceFolder}, // 调试程序时的工作目录一般为${workspaceFolder}即代码所在目录 environment: [], externalConsole: false, // 调试时是否显示控制台窗口一般设置为true显示控制台 MIMode: gdb, miDebuggerPath: D:/Setting/mingw64/bin/gdb.exe, // miDebugger的路径注意这里要与MinGw的路径对应 preLaunchTask: g, // 调试会话开始前执行的任务一般为编译程序c为g, c为gcc setupCommands: [ { description: Enable pretty-printing for gdb, text: -enable-pretty-printing, ignoreFailures: true } ] } ]
}task.json {version: 2.0.0,command: g,args: [-g,${file},-o,${workspaceFolder}/exe/${fileBasenameNoExtension}.exe,-stdc17,D:/Setting/opencv/build/x64/mingw/bin/libopencv_world460.dll,-I,D:/Setting/opencv/build/x64/mingw/install/include,// -lprotobuf -lpthread],problemMatcher: {owner: cpp,fileLocation: [relative,\\],pattern: {regexp: ^(.*):(\\d):(\\d):\\s(warning|error):\\s(.*)$,file: 1,line: 2,column: 3,severity: 4,message: 5}},tasks: [{type: cppbuild,label: C/C: g.exe 生成活动文件,command: D:\\BasicSetting\\mingw64\\bin\\g.exe,args: [-fdiagnostics-coloralways,-g,${file},-o,${fileDirname}\\${fileBasenameNoExtension}.exe,-stdc17,D:/Setting/opencv/build/x64/mingw/bin/libopencv_world460.dll,-I,D:/Setting/opencv/build/x64/mingw/install/include,],options: {cwd: ${fileDirname}},problemMatcher: [$gcc],group: {kind: build,isDefault: true},detail: 调试器生成的任务。}]
}