国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Python > 正文

VSCode下配置python調試運行環境的方法

2020-02-22 23:37:01
字體:
來源:轉載
供稿:網友

VSCode配置python調試環境

很久之前的一個東東,翻出來看看

VSCode配置python調試環境
* 1.下載python解釋器
* 2.在VSCode市場中安裝Python插件
* 4.在用戶設置里加兩條
* 5.接下來是正式的調試了 1080 兩個數的平方和 Input Output Input示例 Output示例

1.下載python解釋器

python 3.6.3 for windows

安裝到系統某個路徑例如C:/Python36
最好添加到Path,也可以不加

2.在VSCode市場中安裝Python插件

python插件

3.同樣是打開一個文件夾,新建一個.py文件(這樣容易識別項目,vscode就需要新建一個文件夾)
4.同樣是launch.json文件和tasks.json文件

launch.josn

{ // 使用 IntelliSense 了解相關屬性。  // 懸停以查看現有屬性的描述。 // 欲了解更多信息,請訪問: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [  {   "name": "Python",   "type": "python",   "request": "launch",   "stopOnEntry": false,//是否在第一條語句時程序停止,下面的這個選項都一樣   "pythonPath": "C:/Python34/python",//可執行文件路徑   "program": "${file}",   "cwd": "${workspaceRoot}",   "env": {},   "envFile": "${workspaceRoot}/.env",   "debugOptions": [    "WaitOnAbnormalExit",    "WaitOnNormalExit",    "RedirectOutput"   ]  },  {   "name": "PySpark",   "type": "python",   "request": "launch",   "stopOnEntry": true,   "osx": {    "pythonPath": "${env:SPARK_HOME}/bin/spark-submit"   },   "windows": {    "pythonPath": "${env:SPARK_HOME}/bin/spark-submit.cmd"   },   "linux": {    "pythonPath": "${env:SPARK_HOME}/bin/spark-submit"   },   "program": "${file}",   "cwd": "${workspaceRoot}",   "env": {},   "envFile": "${workspaceRoot}/.env",   "debugOptions": [    "WaitOnAbnormalExit",    "WaitOnNormalExit",    "RedirectOutput"   ]  },  {   "name": "Python Module",   "type": "python",   "request": "launch",   "stopOnEntry": false,   "pythonPath": "${config:python.pythonPath}",   "module": "module.name",   "cwd": "${workspaceRoot}",   "env": {},   "envFile": "${workspaceRoot}/.env",   "debugOptions": [    "WaitOnAbnormalExit",    "WaitOnNormalExit",    "RedirectOutput"   ]  },  {   "name": "Integrated Terminal/Console",   "type": "python",   "request": "launch",   "stopOnEntry": false,   "pythonPath": "${config:python.pythonPath}",   "program": "${file}",   "cwd": "",   "console": "integratedTerminal",   "env": {},   "envFile": "${workspaceRoot}/.env",   "debugOptions": [    "WaitOnAbnormalExit",    "WaitOnNormalExit"   ]  },  {   "name": "External Terminal/Console",   "type": "python",   "request": "launch",   "stopOnEntry": false,   "pythonPath": "${config:python.pythonPath}",   "program": "${file}",   "cwd": "",   "console": "externalTerminal",   "env": {},   "envFile": "${workspaceRoot}/.env",   "debugOptions": [    "WaitOnAbnormalExit",    "WaitOnNormalExit"   ]  },  {   "name": "Django",   "type": "python",   "request": "launch",   "stopOnEntry": false,   "pythonPath": "${config:python.pythonPath}",   "program": "${workspaceRoot}/manage.py",   "cwd": "${workspaceRoot}",   "args": [    "runserver",    "--noreload",    "--nothreading"   ],   "env": {},   "envFile": "${workspaceRoot}/.env",   "debugOptions": [    "WaitOnAbnormalExit",    "WaitOnNormalExit",    "RedirectOutput",    "DjangoDebugging"   ]  },  {   "name": "Flask",   "type": "python",   "request": "launch",   "stopOnEntry": false,   "pythonPath": "${config:python.pythonPath}",   "program": "fully qualified path fo 'flask' executable. Generally located along with python interpreter",   "cwd": "${workspaceRoot}",   "env": {    "FLASK_APP": "${workspaceRoot}/quickstart/app.py"   },   "args": [    "run",    "--no-debugger",    "--no-reload"   ],   "envFile": "${workspaceRoot}/.env",   "debugOptions": [    "WaitOnAbnormalExit",    "WaitOnNormalExit",    "RedirectOutput"   ]  },  {   "name": "Flask (old)",   "type": "python",   "request": "launch",   "stopOnEntry": false,   "pythonPath": "${config:python.pythonPath}",   "program": "${workspaceRoot}/run.py",   "cwd": "${workspaceRoot}",   "args": [],   "env": {},   "envFile": "${workspaceRoot}/.env",   "debugOptions": [    "WaitOnAbnormalExit",    "WaitOnNormalExit",    "RedirectOutput"   ]  },  {   "name": "Pyramid",   "type": "python",   "request": "launch",   "stopOnEntry": true,   "pythonPath": "${config:python.pythonPath}",   "cwd": "${workspaceRoot}",   "env": {},   "envFile": "${workspaceRoot}/.env",   "args": [    "${workspaceRoot}/development.ini"   ],   "debugOptions": [    "WaitOnAbnormalExit",    "WaitOnNormalExit",    "RedirectOutput",    "Pyramid"   ]  },  {   "name": "Watson",   "type": "python",   "request": "launch",   "stopOnEntry": true,   "pythonPath": "${config:python.pythonPath}",   "program": "${workspaceRoot}/console.py",   "cwd": "${workspaceRoot}",   "args": [    "dev",    "runserver",    "--noreload=True"   ],   "env": {},   "envFile": "${workspaceRoot}/.env",   "debugOptions": [    "WaitOnAbnormalExit",    "WaitOnNormalExit",    "RedirectOutput"   ]  },  {   "name": "Attach (Remote Debug)",   "type": "python",   "request": "attach",   "localRoot": "${workspaceRoot}",   "remoteRoot": "${workspaceRoot}",   "port": 3000,   "secret": "my_secret",   "host": "localhost"  } ]}            
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 嘉义县| 东丽区| 庆阳市| 永寿县| 仪征市| 龙泉市| 崇阳县| 邵阳市| 兴国县| 怀远县| 太保市| 濮阳市| 宁强县| 长沙市| 娱乐| 西青区| 托克托县| 沐川县| 鄄城县| 南丹县| 壤塘县| 白朗县| 宜川县| 沙田区| 新干县| 时尚| 吉首市| 孙吴县| 高台县| 邛崃市| 商丘市| 香港| 庄浪县| 诏安县| 姚安县| 平定县| 奈曼旗| 西乌珠穆沁旗| 荥经县| 桂东县| 房产|