摘要:在完成設(shè)置編輯之后,輸入來保存更改,更改會立即生效。調(diào)試配置文件使用了解相關(guān)屬性。欲了解更多信息,請訪問任務(wù)配置直接運行配置
配置編輯器 1. 基礎(chǔ)設(shè)置settings.json
VS Code有很多選項可以來配置編輯器,你可以通過用戶設(shè)置來設(shè)置全局選項,或在工作空間設(shè)置中針對每個文件夾或項目設(shè)置,選項設(shè)置保存在settings.json?文件中。
Files?>?Preferences?>?User Settings?(或者按下?kb(workbench.action.showCommands), 輸入?user?然后按下?Enter) 來編輯 settings.json 文件.
Files?>?Preferences?>?Workspace Settings?(或者按下?kb(workbench.action.showCommands), 輸入?worksp?然后按下?Enter) 來編輯工作空間的 settings.json 文件.
你會看到VS Code?默認配置在左側(cè)窗口并且你編輯的?settings.json?在右側(cè)。你可以只是從默認設(shè)置查看和拷貝設(shè)置。
在完成設(shè)置編輯之后,輸入?kb(workbench.action.files.save)?來保存更改,更改會立即生效。
settings.json
{ "python.pythonPath": "/usr/local/opt/python3/bin/python3.6" }2. 調(diào)試配置文件launch.json
launch.json
{ // 使用 IntelliSense 了解相關(guān)屬性。 // 懸停以查看現(xiàn)有屬性的描述。 // 欲了解更多信息,請訪問: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Python", "type": "python", "request": "launch", "stopOnEntry": true, "pythonPath": "${config:python.pythonPath}", "program": "${file}", "cwd": "${workspaceRoot}", "env": {}, "envFile": "${workspaceRoot}/.env", "debugOptions": [ "WaitOnAbnormalExit", "WaitOnNormalExit", "RedirectOutput" ] }, { "name": "Python: Attach", "type": "python", "request": "attach", "localRoot": "${workspaceRoot}", "remoteRoot": "${workspaceRoot}", "port": 3000, "secret": "my_secret", "host": "localhost" }, { "name": "Python: Terminal (integrated)", "type": "python", "request": "launch", "stopOnEntry": true, "pythonPath": "${config:python.pythonPath}", "program": "${file}", "cwd": "", "console": "integratedTerminal", "env": {}, "envFile": "${workspaceRoot}/.env", "debugOptions": [ "WaitOnAbnormalExit", "WaitOnNormalExit" ] }, { "name": "Python: Terminal (external)", "type": "python", "request": "launch", "stopOnEntry": true, "pythonPath": "${config:python.pythonPath}", "program": "${file}", "cwd": "", "console": "externalTerminal", "env": {}, "envFile": "${workspaceRoot}/.env", "debugOptions": [ "WaitOnAbnormalExit", "WaitOnNormalExit" ] }, { "name": "Python: Django", "type": "python", "request": "launch", "stopOnEntry": true, "pythonPath": "${config:python.pythonPath}", "program": "${workspaceRoot}/manage.py", "cwd": "${workspaceRoot}", "args": [ "runserver", "--noreload", "--nothreading" ], "env": {}, "envFile": "${workspaceRoot}/.env", "debugOptions": [ "WaitOnAbnormalExit", "WaitOnNormalExit", "RedirectOutput", "DjangoDebugging" ] }, { "name": "Python: Flask (0.11.x or later)", "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": "Python: Flask (0.10.x or earlier)", "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": "Python: 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": true, "pythonPath": "${config:python.pythonPath}", "module": "module.name", "cwd": "${workspaceRoot}", "env": {}, "envFile": "${workspaceRoot}/.env", "debugOptions": [ "WaitOnAbnormalExit", "WaitOnNormalExit", "RedirectOutput" ] }, { "name": "Python: 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": "Python: 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" ] } ] }3. 任務(wù)配置(直接運行配置)tasks.json
tasks.json
{ "version": "0.1.0", "command": "python3", "isShellCommand": true, "args": ["${file}"], "showOutput": "always" }
文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請注明本文地址:http://m.hztianpu.com/yun/41034.html
摘要:使用文件頭部注釋在當(dāng)前編輯文件中使用快捷鍵即可生成文件頭部注釋。事實上,函數(shù)注釋在文件的任意位置都可生成,這里需要自己控制。 koroFileHeader 一個讀取用戶自定義模板,通過快捷鍵添加文件頭部注釋、在光標處添加函數(shù)注釋的VsCode插件 language 簡體中文 | English 一些文檔 支持語言 插件設(shè)置/配置 更新日志 常見問題 簡介 文件頭部添加注釋: 在文...
摘要:使用文件頭部注釋在當(dāng)前編輯文件中使用快捷鍵即可生成文件頭部注釋。函數(shù)注釋將光標放在函數(shù)行或者將光標放在函數(shù)上方的空白行使用快捷鍵,即可生成函數(shù)注釋。事實上,函數(shù)注釋在文件的任意位置都可生成,這里需要自己控制。 koroFileHeader 一個讀取用戶自定義模板,通過快捷鍵添加文件頭部注釋、在光標處添加函數(shù)注釋的VsCode插件 language 簡體中文 | English 更新日志...
摘要:作者鐘離,酷家樂客戶端負責(zé)人原文地址酷家樂客戶端下載地址文章背景在酷家樂客戶端在改版成功后,我們積累了許多的寶貴的經(jīng)驗和最佳實踐。鐘離可以注冊多個協(xié)議接收參數(shù)協(xié)議注冊完畢之后,我們已經(jīng)可以在瀏覽器中,通過訪問自定義協(xié)議來啟動客戶端了。 作者:鐘離,酷家樂PC客戶端負責(zé)人原文地址:https://webfe.kujiale.com/browser-to-client/酷家樂客戶端:下載...
摘要:作者鐘離,酷家樂客戶端負責(zé)人原文地址酷家樂客戶端下載地址文章背景在酷家樂客戶端在改版成功后,我們積累了許多的寶貴的經(jīng)驗和最佳實踐。鐘離可以注冊多個協(xié)議接收參數(shù)協(xié)議注冊完畢之后,我們已經(jīng)可以在瀏覽器中,通過訪問自定義協(xié)議來啟動客戶端了。 作者:鐘離,酷家樂PC客戶端負責(zé)人原文地址:https://webfe.kujiale.com/browser-to-client/酷家樂客戶端:下載...
摘要:統(tǒng)一碼,萬國碼編碼此時應(yīng)運而生,年由統(tǒng)一碼聯(lián)盟首次發(fā)布標準。英文占個字節(jié)歐洲語系占個東亞占個,其它及特殊字符占個使用個字節(jié)表示所有字符優(yōu)先使用個字節(jié),否則使用個字節(jié)表示。退出交互式環(huán)境,使用。 < 返回索引頁 計算機編程基礎(chǔ)知識 編程入門準備知識 計算機基本組成 計算機中的編碼 一門語言的基本組成 環(huán)境搭建 Python下載和安裝(window/mac/linux...
閱讀 2935·2021-10-21 09:38
閱讀 2866·2021-10-11 10:59
閱讀 3198·2021-09-27 13:36
閱讀 1740·2021-08-23 09:43
閱讀 886·2019-08-29 14:14
閱讀 3105·2019-08-29 12:13
閱讀 3256·2019-08-29 12:13
閱讀 363·2019-08-26 12:24