当前位置:   article > 正文

vscode ~ launch.json配置python_vscode launch.json python

vscode launch.json python

配置文件内容

  1. {
  2. // Use IntelliSense to learn about possible attributes.
  3. // Hover to view descriptions of existing attributes.
  4. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  5. "version": "0.2.0",
  6. "configurations": [
  7. {
  8. "name": "Python",
  9. "type": "python",
  10. "request": "launch",
  11. "stopOnEntry": false,
  12. "pythonPath": "C:\\Users\\hetao\\anaconda3\\python.exe",
  13. "program": "${file}",
  14. "cwd": "${workspaceRoot}",
  15. "env": {},
  16. "envFile": "${workspaceRoot}/.env",
  17. "debugOptions": [
  18. "WaitOnAbnormalExit",
  19. "WaitOnNormalExit",
  20. "RedirectOutput"
  21. ]
  22. }
  23. ]
  24. }

查看python解释器路径

  1. import sys
  2. import os
  3. print('当前 Python 解释器路径:')
  4. print(sys.executable)
  5. r"""
  6. 当前 Python 解释器路径:
  7. C:\Users\jpch89\AppData\Local\Programs\Python\Python36\python.EXE
  8. """
  9. print()
  10. print('当前 Python 解释器目录:')
  11. print(os.path.dirname(sys.executable))
  12. r"""
  13. 当前 Python 解释器目录:
  14. C:\Users\jpch89\AppData\Local\Programs\Python\Python36
  15. """



CVisual Studio Code (vscode) 配置 C / C++ 环境 - 步平凡 - 博客园

Visual Studio Code (vscode) 配置 C / C++ 环境 - 步平凡 - 博客园

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/366603
推荐阅读
相关标签
  

闽ICP备14008679号