Just add cProfile module to the running command: python3 -m cProfile test.py For example: $ python3 -m cProfile test.py 14 function calls in 0.000 seconds Ordered by: standard name ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 0.000 0.000 test.py:1() 10 0.000 0.000 0.000 0.000 test.py:1(func) 1 0.000 0.000 0.000 0.000 test.py:4() 1 0.000 0.000 0.000Continue Reading
Tag: Python
What’s new in Python 3.8: the Walrus Operator
The new operator will be available in the new version of Python. It’s called “walrus operator” because it’s like someone cosplayed a walrus: “:=”. This is similar to the normal ” =” assignment, but returns the value of the statement. So this is a C-like assignment. For eaxmple, we can use it for a one-lineContinue Reading