【问题标题】:VSCode Pyramid DebugVSCode 金字塔调试
【发布时间】:2017-10-19 22:20:15
【问题描述】:

我正在努力在 Linux 机器上配置 VSCode 以开始调试金字塔应用程序(通过 pserve),但没有任何成功。

任何指导将不胜感激。

【问题讨论】:

  • 你尝试了什么?你观察到了什么?报告了哪些错误?
  • 这里一样,找不到单个扩展或解决方法。
  • 找到github.com/Microsoft/vscode-python/issues/519,但这会导致ValueError: source code can not control null byte。
  • 我在尝试创建lauch.json 文件时遇到了同样的问题我收到了这个错误E+00000.007: Error determining module path for sys.argv

标签: python linux debugging visual-studio-code pyramid


【解决方案1】:

我在 Linux 下使用此 VS 代码 launch.json 文件使用 program 选项成功调试了我的 Pyramid 应用程序:

{
  // 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: Pyramid Application",
      "type": "python",
      "request": "launch",
      "program": "FullPathToExecutableFileHere",
      "args": [
        "param1",
        "${workspaceFolder}/XXX.ini"
      ],
      "pyramid": true,
      "jinja": true
    }
  ]
}

通过提供可执行文件的完整路径,并在args 部分提供参数。

我现在可以在任何 python 源文件代码中设置断点。

不要忘记使用CTRL + Shift + P 将python解释器的路径设置为您的应用程序所需的特定python虚拟环境

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-09-14
    • 2017-06-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-19
    • 2014-07-02
    • 2015-07-01
    相关资源
    最近更新 更多