在python中运行bandit的更简洁的方法是什么,而不涉及炮击

2024-06-16 10:05:57 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用以下包:https://github.com/PyCQA/bandit对运行时执行一些静态分析。目前我做了以下工作:

subprocess.Popen(['bandit', '-r', full_path], stdout=subprocess.PIPE)

但我正试图摆脱使用subprocess.Popen,有可能在python中本机调用bandit吗?差不多

from bandit import ...
run_bandit(directory, recursive=True)

Tags: pathfromhttpsimportgithubcomstdout静态