Tgsadman
Tgsadman

Reputation: 38

When I run python in vscode it opens a tab in my browser

When I run python in VSCODE it opens a tab in my browser. Even if I do the simplest code.

For example, print("hello world"). The same happens when I run a html file. And the new tab say local host refused to connect.

I solved the html issue with open in default browser but I can't seem to fix the problem with the python code.

Sorry if how I phrased that sounded weird. What I have tried: deleting extensions that may open in code in browser.

Upvotes: 1

Views: 1102

Answers (1)

Mihir Joshi
Mihir Joshi

Reputation: 450

This is the default configuration of launch.json file:

launch.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": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        }
    ]
}

Upvotes: 1

Related Questions