将 pdb 与备用 Python 安装一起使用
Using pdb with alternate Python installation
我的电脑上安装了两个 Python,Python 2.7 在 /usr/bin
和 Python 3.3 安装在 Miniconda 下。
我想在命令行上使用 pdb
进行调试,例如$ pdb main.py
并使其 运行 使用 Python 3.3 版本而不是 Python 2.7 版本。
我该怎么做?
我能想到的最简单的方法是将模块作为脚本调用:
/where/is/my/python -m pdb main.py
我的电脑上安装了两个 Python,Python 2.7 在 /usr/bin
和 Python 3.3 安装在 Miniconda 下。
我想在命令行上使用 pdb
进行调试,例如$ pdb main.py
并使其 运行 使用 Python 3.3 版本而不是 Python 2.7 版本。
我该怎么做?
我能想到的最简单的方法是将模块作为脚本调用:
/where/is/my/python -m pdb main.py