Make VS code run .py file in command prompt?
Go to solution
Solved by phleexiou,
Actually i figured it out. in launch.json i copied the existing config, and changed "console": "integratedTerminal" to "console": "externalTerminal".
my new launch.json looks like this:
{
// 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"
},
{
"name": "run in cmd?",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "externalTerminal"
}
]
}
The in the bottom left next to python version and errors/warnings, click on the run method and change it to the "run in cmd?" one, or whatever you choose to name it.
The in the bottom left next to python version and errors/warnings, click on the run method and change it to the "run in cmd?" one, or whatever you choose to name it.
This wont change the play button in the top right, but now when you hit f5, it will run in a discrete window.

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now