在浏览器中打开Visual Studio代码



我下载了VSC,最近我在ubuntu中打开了jupyter notebook。现在,当我尝试在VSC中运行我的程序时,它一直在chrome中打开浏览器,并说"无法访问此站点:本地主机连接失败"。我看了一些网站,他们说要删除

"action": "openExternally",
"pattern": "^\s*Now listening on:\s+(https?://\S+)"
},

从launch:json文件。但是当我打开启动器。Json文件里面写着

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}

有人能帮帮我吗?谢谢你的宝贵时间

直接删除(或注释掉)这整个部分。

"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"

这是打开chrome的说明,所以如果你删除它,chrome不会在运行时打开。

添加以下设置以正常运行python -

"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"

有关更多细节,请查看启动时的vs code页面。json配置。

最新更新