1

Usually if you have a script foo.py you can easily profile it as follows:

python -m cProfile foo.py

However let's imagine I am already running foo as a module with -m:

python -m path.foo

In this case is there a clean way to profile this execution? I have tried:

python -m cProfile -m path.foo

Clearly it did not work but you get what I am trying to do so how do I do it?

Evan Pu
  • 2,099
  • 5
  • 21
  • 36

0 Answers0