Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using cProfile on application with entry point

I know cProfile can be used like this

python -m cProfile script.py

But suppose I have a packaged application (pip-installable) with an entry_point defined in setup.py, such that I can call the application from the terminal, without explicitly using any .py file. How can I use cProfile in that case?

like image 798
foxpal Avatar asked Jun 23 '26 17:06

foxpal


1 Answers

I found the answer in this thread:

python -m cProfile $(which application)
like image 175
foxpal Avatar answered Jun 25 '26 05:06

foxpal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!