0

Is there an option in pdb or some other python debugging tool to print on screen/print to file every line of code that is being accessed ? I am going through some huge amounts of code so copying pasting by hand is tedious. I am wondering if someone could give me tips on how to do this in python or tell me if there are existing tools that do so.

1 Answer 1

3

Looks like you want a code coverage tool. Try coverage, which will tell you which lines have been executed.

Taking a look at the example in the documentation, it can display which lines were executed: http://nedbatchelder.com/code/coverage/sample_html/cogapp_test_cogapp.html

Take a look at the 'reporting' and 'annotating' areas of the docs for info on how to get the most suitable output for your purposes.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, how do I use coverage to tell me which lines are executed? THe tutorial seems to provide code coverage as a % , how do you see which lines?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.