Ahoijer
Ahoijer

Reputation: 11

Make Python shell show commands as they are done

How do I make the python shell print/show the commands that is done exactly when its done?

For an example is, If my python file contains:

variable = something
IF variable == something:
    print “hello”

So when I run the file in python shell, I want it to print all the commands as they are executed.

Upvotes: 0

Views: 81

Answers (1)

Ron Serruya
Ron Serruya

Reputation: 4446

You can use the built-in trace module

python3 -m trace --trace file.py

Upvotes: 3

Related Questions