.vscode
目錄結構:
配置文件內容.env
的內容如下:
PYTHONPATH=./:${PYTHONPATH}
其中./
表示當前工作目錄settings.json
的內容如下:
{
"python.pythonPath": "/home/jovyan/.conda/envs/tf_1.15/bin/python",
"jupyter.jupyterServerType": "local",
"python.linting.enabled": false,
"terminal.integrated.fontFamily": "Ubuntu mono",
"terminal.integrated.fontSize": 16,
"python.envFile": "${workspaceFolder}/.vscode/.env", #引用環境變量文件`.env`
}
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",
}
]
}