1
1
Fork 0

feat: add vscode debugger

master
Terminator 2023-11-30 00:14:57 +07:00
parent 38601033af
commit 2db2cdc1ff
3 changed files with 37 additions and 0 deletions

@ -0,0 +1,16 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Debug Main.py",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/src/main.py",
"console": "integratedTerminal",
"env": {
"PYTHONPATH": "${workspaceFolder}"
},
"preLaunchTask": "Setup Environment",
}
]
}

12
.vscode/tasks.json vendored

@ -0,0 +1,12 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Setup Environment",
"type": "shell",
"command": "python",
"args": ["activate_env.py"],
"problemMatcher": []
}
]
}

@ -0,0 +1,9 @@
import subprocess
import os
# Ativa o ambiente virtual
subprocess.run([r'.\venv\Scripts\activate.bat'], shell=True)
# Configura as variáveis de ambiente
os.environ['PATH'] = r'.\bin;' + os.environ['PATH']
os.environ['PYTHONUTF8'] = '1'