PyCharm 中的分析模块

The*_*len 7 python profiling pycharm

跟进这个问题: 创建一个运行模块的 PyCharm 配置“python -m foo”

使用 2018.1 中的新选项,运行和调试模块对我来说非常有用,您现在可以为其指定要运行的模块。但是,分析相同的配置不起作用。

PyCharm 尝试运行这样的东西:

/path/to/python /path/to/pycharm/plugins/python/helpers/profiler/run_profiler.py 127.0.0.1 44725 -m mypackage.cli.runthis paramA paramB
Run Code Online (Sandbox Code Playgroud)

无论出于何种原因,所有参数(尤其是 -m)都转发到我的包,并且 argparse 抱怨它不知道 -m。正如我之前所说,此配置非常适合运行/调试。知道如何让分析器工作吗?