使用 sudo 权限在 pyCharm 中调试? [英] Debugging in pyCharm with sudo privileges?

查看:59
本文介绍了使用 sudo 权限在 pyCharm 中调试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过运行 sudo pycharm.shpyCharm 中测试了需要 root 访问权限的代码,但这不是我推荐的方式.

I've tested code that requires root access in pyCharm by running sudo pycharm.sh but this is not the way I would recommend of doing so.

我知道可以通过在 pyCharm 中将 python 解释器作为 sudo 运行来使用 sudo 权限进行调试,但我们该怎么做呢?

I know it's possible to debug with sudo privileges by running the python interpreter as sudo in pyCharm but how do we do this?

推荐答案

创建一个执行sudo python"并转发参数的 shell 脚本,并将该脚本配置为 PyCharm 中的 Python 解释器.

Create a shell script that does "sudo python" and forwards the arguments, and configure that script as a Python interpreter in PyCharm.

此 shell 脚本的名称应以 python 开头(来源:http://forum.jetbrains.com/message/PyCharm-424-3).

Name of this shell script should start with python (source: http://forum.jetbrains.com/message/PyCharm-424-3).

这篇关于使用 sudo 权限在 pyCharm 中调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆