I have a project that requires me to convert the Python file to a exe file using pyinstaller -F main.py.
I run the aforementioned command in the terminal and I am able use the exe as intended.
However, when I try to set up a VS Code launch config which automatically runs the command and then runs the exe, I am unable to find a suitable launch type to run the exe file. What type do I use so that the exe file can be run without issues?
launch.json:
{
"configurations": [
{
"name": "Launch",
"type": "debugpy", //Cannot use this type as exe files cannot be run by the Python debugger (obviously)
"request": "launch",
"args": [],
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/dist/main.exe",
"preLaunchTask": "Package App",
}
]
}
tasks.json:
{
"tasks": [
{
"type": "shell",
"label": "Package App",
"command": "pyinstaller -F main.py",
"args": [],
"options": {
"cwd": "${workspaceRoot}"
},
"problemMatcher": ["$python"],
"group": {
"kind": "build",
"isDefault": true,
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
