使用 VSCode 进行开发调试 #934
zzc-tongji
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
English | 日本語
安装 miniconda ,使用
conda创建虚拟环境okww,安装pip依赖:在 VSCode 中打开
<repo-dir>,安装 Python 插件。在
<repo-dir>中新建 .vscode 文件夹:文件
launch.json:{ "version": "0.2.0", "configurations": [ { "name": "OK-WW (run)", "type": "debugpy", "request": "launch", "cwd": "${workspaceFolder}", "program": "main_debug.py", "console": "integratedTerminal", }, { "name": "OK-WW (i18n)", "type": "PowerShell", "request": "launch", "cwd": "${workspaceFolder}", "script": "conda run -n okww python .agents/skills/ok-script-i18n/scripts/task_i18n_helper.py compile --i18n i18n && conda run -n okww python .agents/skills/ok-script-i18n/scripts/task_i18n_helper.py check --i18n i18n", } ] }文件
settings.json:{ "python.defaultInterpreterPath": "C:/Users/<user-name>/.conda/envs/okww/python.exe", "python-envs.pythonProjects": [ { "path": ".", "envManager": "ms-python.python:conda", "packageManager": "ms-python.python:conda" } ] }(如果 VSCode 提示找不到 Python ,可以用
conda env list查看虚拟环境 okww 安装位置,然后填入。)按下
Cntl + Shift + P键入Python: Select Interpreter选择Use Python from `python.defaultInterpreterPath` setting或者okww。完成后,面板
Debug and Run中会出现:OK-WW (run)- 以 debug 模式运行 ok-ww,支持断点调试。OK-WW (i18n)- 按照 i18n 文件夹中各个语言的 po 文件生成对应的 mo 文件。Beta Was this translation helpful? Give feedback.
All reactions